Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 62889d7

Browse filesBrowse files
dynstaduh95
authored andcommitted
doc: clarify require(esm) description
PR-URL: #60520 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
1 parent 0b9ef68 commit 62889d7
Copy full SHA for 62889d7

File tree

Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+2
-3
lines changed
Open diff view settings
Collapse file

‎doc/api/modules.md‎

Copy file name to clipboardExpand all lines: doc/api/modules.md
+2-3Lines changed: 2 additions & 3 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -255,9 +255,8 @@ This property is experimental and can change in the future. It should only be us
255255
by tools converting ES modules into CommonJS modules, following existing ecosystem
256256
conventions. Code authored directly in CommonJS should avoid depending on it.
257257

258-
When an ES Module contains both named exports and a default export, the result returned by `require()`
259-
is the [module namespace object][], which places the default export in the `.default` property, similar to
260-
the results returned by `import()`.
258+
The result returned by `require()` is the [module namespace object][], which places
259+
the default export in the `.default` property, similar to the results returned by `import()`.
261260
To customize what should be returned by `require(esm)` directly, the ES Module can export the
262261
desired value using the string name `"module.exports"`.
263262

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.