Skip to content

Commit dc27ff4

Browse files
committed
doc: small clarifications to modules.markdown
per: nodejs/node-v0.x-archive#8708 A modified version of the original PR submitted by @builtbylane. Reviewed By: Sakthipriyan Vairamani <[email protected]> PR-URL: #2378
1 parent 4215d28 commit dc27ff4

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

doc/api/modules.markdown

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,12 @@ plan accordingly.
120120
Node.js has several modules compiled into the binary. These modules are
121121
described in greater detail elsewhere in this documentation.
122122

123+
<<<<<<< HEAD
123124
The core modules are defined in Node.js's source in the `lib/` folder.
125+
=======
126+
The core modules are defined within io.js's source and are located in the
127+
`lib/` folder.
128+
>>>>>>> doc: small clarifications to modules.markdown
124129
125130
Core modules are always preferentially loaded if their identifier is
126131
passed to `require()`. For instance, `require('http')` will always
@@ -130,23 +135,29 @@ return the built in HTTP module, even if there is a file by that name.
130135

131136
<!--type=misc-->
132137

138+
<<<<<<< HEAD
133139
If the exact filename is not found, then Node.js will attempt to load the
134140
required filename with the added extension of `.js`, `.json`, and then `.node`.
141+
=======
142+
If the exact filename is not found, then io.js will attempt to load the
143+
required filename with the added extensions: `.js`, `.json`, and finally
144+
`.node`.
145+
>>>>>>> doc: small clarifications to modules.markdown
135146
136147
`.js` files are interpreted as JavaScript text files, and `.json` files are
137148
parsed as JSON text files. `.node` files are interpreted as compiled addon
138149
modules loaded with `dlopen`.
139150

140-
A module prefixed with `'/'` is an absolute path to the file. For
151+
A required module prefixed with `'/'` is an absolute path to the file. For
141152
example, `require('/home/marco/foo.js')` will load the file at
142153
`/home/marco/foo.js`.
143154

144-
A module prefixed with `'./'` is relative to the file calling `require()`.
145-
That is, `circle.js` must be in the same directory as `foo.js` for
155+
A required module prefixed with `'./'` is relative to the file calling
156+
`require()`. That is, `circle.js` must be in the same directory as `foo.js` for
146157
`require('./circle')` to find it.
147158

148-
Without a leading '/', './', or '../' to indicate a file, the module is either a
149-
core module or is loaded from a `node_modules` folder.
159+
Without a leading '/', './', or '../' to indicate a file, the module must
160+
either be a core module or is loaded from a `node_modules` folder.
150161

151162
If the given path does not exist, `require()` will throw an Error with its
152163
`code` property set to `'MODULE_NOT_FOUND'`.

0 commit comments

Comments
 (0)