Skip to content

Commit 4ecebf4

Browse files
committed
doc: document import.meta.require
1 parent ab93018 commit 4ecebf4

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

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)