diff options
Diffstat (limited to 'doc/api/modules.md')
-rw-r--r-- | doc/api/modules.md | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/doc/api/modules.md b/doc/api/modules.md index 48a4d1f3cfb..5f1cf96ebb4 100644 --- a/doc/api/modules.md +++ b/doc/api/modules.md @@ -67,11 +67,7 @@ The module system is implemented in the `require('module')` module. When a file is run directly from Node.js, `require.main` is set to its `module`. That means that you can determine whether a file has been run -directly by testing - -```js -require.main === module; -``` +directly by testing `require.main === module`. For a file `foo.js`, this will be `true` if run via `node foo.js`, but `false` if run by `require('./foo')`. @@ -556,6 +552,7 @@ exports = { hello: false }; // Not exported, only available in the module When the `module.exports` property is being completely replaced by a new object, it is common to also reassign `exports`, for example: +<!-- eslint-disable func-name-matching --> ```js module.exports = exports = function Constructor() { // ... etc. |