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 4f168a4

Browse filesBrowse files
viceMylesBorins
authored andcommitted
doc: require() tries first core not native modules
Change a single word in documentation with a more precise one. Native is a module compiled in machine "native" code. A module normally written in a compiled language, not in JavaScript. Core modules form Node's built-in "core" functionalities. You don't need to install them. They are included in every Node installation and documented in https://nodejs.org/api/ . PR-URL: #10324 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Italo A. Casas <me@italoacasas.com> Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com> Reviewed-By: Sam Roberts <vieuxtech@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 5777c79 commit 4f168a4
Copy full SHA for 4f168a4

File tree

Expand file treeCollapse file tree

1 file changed

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

1 file changed

+5
-5
lines changed
Open diff view settings
Collapse file

‎doc/api/modules.md‎

Copy file name to clipboardExpand all lines: doc/api/modules.md
+5-5Lines changed: 5 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -368,11 +368,11 @@ example, then `require('./some-library')` would attempt to load:
368368

369369
<!--type=misc-->
370370

371-
If the module identifier passed to `require()` is not a native module,
372-
and does not begin with `'/'`, `'../'`, or `'./'`, then Node.js starts at the
373-
parent directory of the current module, and adds `/node_modules`, and
374-
attempts to load the module from that location. Node will not append
375-
`node_modules` to a path already ending in `node_modules`.
371+
If the module identifier passed to `require()` is not a
372+
[core](#modules_core_modules) module, and does not begin with `'/'`, `'../'`, or
373+
`'./'`, then Node.js starts at the parent directory of the current module, and
374+
adds `/node_modules`, and attempts to load the module from that location. Node
375+
will not append `node_modules` to a path already ending in `node_modules`.
376376

377377
If it is not found there, then it moves to the parent directory, and so
378378
on, until the root of the file system is reached.

0 commit comments

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