Skip to content

Commit bf9a18c

Browse files
committed
doc: document import.meta.require
1 parent c503b5c commit bf9a18c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/esm.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ The `import.meta` metaproperty is an `Object` that contains the following
4545
property:
4646

4747
* `url` {string} The absolute `file:` URL of the module.
48+
* `require` {Function} To require CommonJS modules. This function enables
49+
interoperability between CJS and ESM. See [`require()`]. None of the properties
50+
generally exposed on require are available via `import.meta.require`.
4851

4952
### Unsupported
5053

@@ -256,3 +259,4 @@ in the import tree.
256259
[Node.js EP for ES Modules]: https://github.com/nodejs/node-eps/blob/master/002-es-modules.md
257260
[addons]: addons.html
258261
[dynamic instantiate hook]: #esm_dynamic_instantiate_hook
262+
[`require()`]: modules.html#modules_require

0 commit comments

Comments
 (0)