Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

doc: fix Folders as Modules omission of index.json #8868

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions doc/api/modules.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,13 @@ If this was in a folder at `./some-library`, then

This is the extent of Node's awareness of package.json files.

If there is no package.json file present in the directory, then node
will attempt to load an `index.js` or `index.node` file out of that
If there is no package.json file present in the directory, then node will
attempt to load an `index.js`, `index.json`, or `index.node` file out of that
directory. For example, if there was no package.json file in the above
example, then `require('./some-library')` would attempt to load:

* `./some-library/index.js`
* `./some-library/index.json`
* `./some-library/index.node`

## Caching
Expand Down