Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: ESM documentation consolidation and reordering #36046

Closed
wants to merge 14 commits into from
Prev Previous commit
Next Next commit
remove dlopen example, createRequire mention first
  • Loading branch information
guybedford committed Nov 12, 2020
commit eadbbf0a735d5042295b424d8c0e1aa8d021f1b0
12 changes: 1 addition & 11 deletions doc/api/esm.md
Original file line number Diff line number Diff line change
Expand Up @@ -439,17 +439,7 @@ Alterantively `module.createRequire()` can be used.

Native modules are not currently supported with ES module imports.

They can be loaded directly with `process.dlopen`:

```js
import process from 'process';
import { fileURLToPath } from 'url';

const module = { exports: {} };
process.dlopen(module, fileURLToPath(new URL('./local.node', import.meta.url)));
```

Alternatively `module.createRequire()` can be used.
The can instead be loaded with `module.createRequire()` or `process.dlopen`.
guybedford marked this conversation as resolved.
Show resolved Hide resolved

#### No `require.resolve`

Expand Down