Skip to content

Commit ebc4d5c

Browse files
committed
Remove duplicate docs about main module
1 parent eb7d762 commit ebc4d5c

File tree

1 file changed

+0
-17
lines changed

1 file changed

+0
-17
lines changed

doc/api/modules.markdown

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -350,23 +350,6 @@ The example module above could be structured like so:
350350
Node executes the callback immediately, so please plan your programs
351351
accordingly.
352352

353-
354-
### Accessing the main module
355-
356-
When a file is run directly from Node, `require.main` is set to its
357-
`module`. That means that you can determine whether a file has been run
358-
directly by testing
359-
360-
require.main === module
361-
362-
For a file `foo.js`, this will be `true` if run via `node foo.js`, but
363-
`false` if run by `require('./foo')`.
364-
365-
Because `module` provides a `filename` property (normally equivalent to
366-
`__filename`), the entry point of the current application can be obtained
367-
by checking `require.main.filename`.
368-
369-
370353
## Addenda: Package Manager Tips
371354

372355
The semantics of Node's `require()` function were designed to be general

0 commit comments

Comments
 (0)