Correct reference to "process.Module"
[platform/upstream/nodejs.git] / doc / api / globals.markdown
1 ## Global Objects
2
3 These object are available in the global scope and can be accessed from anywhere.
4
5 ### global
6
7 The global namespace object.
8
9 ### process
10
11 The process object. See the `'process object'` section.
12
13 ### require()
14
15 To require modules. See the `'Modules'` section.
16
17 ### require.resolve()
18
19 Use the internal `require()` machinery to look up the location of a module,
20 but rather than loading the module, just return the resolved filename.
21
22 ### require.paths
23
24 An array of search paths for `require()`.  This array can be modified to add
25 custom paths.
26
27 Example: add a new path to the beginning of the search list
28
29     require.paths.unshift('/usr/local/node');
30
31
32 ### __filename
33
34 The filename of the script being executed.  This is the absolute path, and not necessarily
35 the same filename passed in as a command line argument.
36
37 Example: running `node example.js` from `/Users/mjr`
38
39     console.log(__filename);
40     // /Users/mjr/example.js
41
42 ### __dirname
43
44 The dirname of the script being executed.
45
46 Example: running `node example.js` from `/Users/mjr`
47
48     console.log(__dirname);
49     // /Users/mjr
50
51
52 ### module
53
54 A reference to the current module. In particular
55 `module.exports` is the same as the `exports` object. See `src/node.js`
56 for more information.