3 These object are available in the global scope and can be accessed from anywhere.
7 The global namespace object.
9 In browsers, the top-level scope is the global scope. That means that in
10 browsers if you're in the global scope `var something` will define a global
11 variable. In Node this is different. The top-level scope is not the global
12 scope; `var something` inside a Node module will be local to that module.
16 The process object. See the 'process object' section.
20 To require modules. See the 'Modules' section.
24 Use the internal `require()` machinery to look up the location of a module,
25 but rather than loading the module, just return the resolved filename.
29 An array of search paths for `require()`. This array can be modified to add
32 Example: add a new path to the beginning of the search list
34 require.paths.unshift('/usr/local/node');
39 The filename of the script being executed. This is the absolute path, and not necessarily
40 the same filename passed in as a command line argument.
42 Example: running `node example.js` from `/Users/mjr`
44 console.log(__filename);
45 // /Users/mjr/example.js
49 The dirname of the script being executed.
51 Example: running `node example.js` from `/Users/mjr`
53 console.log(__dirname);
59 A reference to the current module. In particular
60 `module.exports` is the same as the `exports` object. See `src/node.js`