@@ -121,6 +121,8 @@ io.js has several modules compiled into the binary. These modules are
121
121
described in greater detail elsewhere in this documentation.
122
122
123
123
The core modules are defined in io.js's source in the ` lib/ ` folder.
124
+ The core modules are defined within io.js's source and are located in the
125
+ ` lib/ ` folder.
124
126
125
127
Core modules are always preferentially loaded if their identifier is
126
128
passed to ` require() ` . For instance, ` require('http') ` will always
@@ -131,22 +133,23 @@ return the built in HTTP module, even if there is a file by that name.
131
133
<!-- type=misc-->
132
134
133
135
If the exact filename is not found, then io.js will attempt to load the
134
- required filename with the added extension of ` .js ` , ` .json ` , and then ` .node ` .
136
+ required filename with the added extensions: ` .js ` , ` .json ` , and finally
137
+ ` .node ` .
135
138
136
139
` .js ` files are interpreted as JavaScript text files, and ` .json ` files are
137
140
parsed as JSON text files. ` .node ` files are interpreted as compiled addon
138
141
modules loaded with ` dlopen ` .
139
142
140
- A module prefixed with ` '/' ` is an absolute path to the file. For
143
+ A required module prefixed with ` '/' ` is an absolute path to the file. For
141
144
example, ` require('/home/marco/foo.js') ` will load the file at
142
145
` /home/marco/foo.js ` .
143
146
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
147
+ A required module prefixed with ` './' ` is relative to the file calling
148
+ ` require() ` . That is, ` circle.js ` must be in the same directory as ` foo.js ` for
146
149
` require('./circle') ` to find it.
147
150
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.
151
+ Without a leading '/', './', or '../' to indicate a file, the module must
152
+ either be a core module or is loaded from a ` node_modules ` folder.
150
153
151
154
If the given path does not exist, ` require() ` will throw an Error with its
152
155
` code ` property set to ` 'MODULE_NOT_FOUND' ` .
0 commit comments