Skip to content

Commit e9cb986

Browse files
meteorqz6targos
authored andcommitted
doc: rephrase dynamic import() description
The description is updated to clarify that dynamic import() is asynchronous, dynamic, and works in both CJS and ESM contexts. The new phrasing also avoids implying it is the only method for loading ES modules in CommonJS. Fixes: #59077 PR-URL: #59224 Reviewed-By: Antoine du Hamel <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
1 parent b711256 commit e9cb986

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

doc/api/esm.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,8 +334,9 @@ fs.readFileSync === readFileSync;
334334

335335
## `import()` expressions
336336

337-
[Dynamic `import()`][] is supported in both CommonJS and ES modules. In CommonJS
338-
modules it can be used to load ES modules.
337+
[Dynamic `import()`][] provides an asynchronous way to import modules. It is
338+
supported in both CommonJS and ES modules, and can be used to load both CommonJS
339+
and ES modules.
339340

340341
## `import.meta`
341342

0 commit comments

Comments
 (0)