Skip to content

Commit

Permalink
doc: require() tries first core not native modules
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Italo A. Casas <[email protected]>
Reviewed-By: Gibson Fahnestock <[email protected]>
Reviewed-By: Sam Roberts <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
vice authored and MylesBorins committed Feb 1, 2017
1 parent 5777c79 commit 4f168a4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions doc/api/modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,11 +368,11 @@ example, then `require('./some-library')` would attempt to load:

<!--type=misc-->

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

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

0 comments on commit 4f168a4

Please sign in to comment.