doc: import() is supported now
PR-URL: https://github.com/nodejs/node/pull/17395 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Timothy Gu <timothygu99@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
a2bdcbab5f
commit
11ebaff15c
@ -33,15 +33,14 @@ node --experimental-modules my-app.mjs
|
|||||||
### Supported
|
### Supported
|
||||||
|
|
||||||
Only the CLI argument for the main entry point to the program can be an entry
|
Only the CLI argument for the main entry point to the program can be an entry
|
||||||
point into an ESM graph. In the future `import()` can be used to create entry
|
point into an ESM graph. Dynamic import can also be used with the flag
|
||||||
points into ESM graphs at run time.
|
`--harmony-dynamic-import` to create entry points into ESM graphs at run time.
|
||||||
|
|
||||||
### Unsupported
|
### Unsupported
|
||||||
|
|
||||||
| Feature | Reason |
|
| Feature | Reason |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| `require('./foo.mjs')` | ES Modules have differing resolution and timing, use language standard `import()` |
|
| `require('./foo.mjs')` | ES Modules have differing resolution and timing, use dynamic import |
|
||||||
| `import()` | pending newer V8 release used in Node.js |
|
|
||||||
| `import.meta` | pending V8 implementation |
|
| `import.meta` | pending V8 implementation |
|
||||||
|
|
||||||
## Notable differences between `import` and `require`
|
## Notable differences between `import` and `require`
|
||||||
|
Loading…
x
Reference in New Issue
Block a user