From 432d54900e8605d994ec5a25924f7fdc02fa0f62 Mon Sep 17 00:00:00 2001 From: koichik Date: Sun, 3 Jul 2011 16:56:38 +0900 Subject: [PATCH] Remove duplicate section in modules.markdown Fixes #1263 --- doc/api/modules.markdown | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/doc/api/modules.markdown b/doc/api/modules.markdown index 13e7949b8dc..59f545e8a1e 100644 --- a/doc/api/modules.markdown +++ b/doc/api/modules.markdown @@ -307,21 +307,6 @@ Because `module` provides a `filename` property (normally equivalent to `__filename`), the entry point of the current application can be obtained by checking `require.main.filename`. -### Accessing the main module - -When a file is run directly from Node, `require.main` is set to its -`module`. That means that you can determine whether a file has been run -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')`. - -Because `module` provides a `filename` property (normally equivalent to -`__filename`), the entry point of the current application can be obtained -by checking `require.main.filename`. - ## Addenda: Package Manager Tips The semantics of Node's `require()` function were designed to be general