From 62c8948109e7c8536f683b34d414ae500c48e91f Mon Sep 17 00:00:00 2001 From: Elan Shanker Date: Sat, 13 Dec 2014 16:06:56 -0500 Subject: [PATCH] doc: fix Folders as Modules omission of index.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This section was inconsistent with the actual behavior of `require` and with other parts of this same document, which do describe the ability to treat index.json as a module’s default file. PR-URL: https://github.com/joyent/node/pull/8868 Reviewed-By: jasnell - James M Snell --- doc/api/modules.markdown | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/api/modules.markdown b/doc/api/modules.markdown index 2e08ae17246..b04d39ace1e 100644 --- a/doc/api/modules.markdown +++ b/doc/api/modules.markdown @@ -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