File tree 1 file changed +0
-17
lines changed 1 file changed +0
-17
lines changed Original file line number Diff line number Diff line change @@ -350,23 +350,6 @@ The example module above could be structured like so:
350
350
Node executes the callback immediately, so please plan your programs
351
351
accordingly.
352
352
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
-
370
353
## Addenda: Package Manager Tips
371
354
372
355
The semantics of Node's ` require() ` function were designed to be general
You can’t perform that action at this time.
0 commit comments