Node.js v8.9.3 英文文档


Global Objects#

查看中文版

These objects are available in all modules. The following variables may appear to be global but are not. They exist only in the scope of modules, see the module system documentation:

The objects listed here are specific to Node.js. There are a number of built-in objects that are part of the JavaScript language itself, which are also globally accessible.

Class: Buffer#

查看中文版

Used to handle binary data. See the buffer section.

__dirname#

查看中文版

This variable may appear to be global but is not. See __dirname.

__filename#

查看中文版

This variable may appear to be global but is not. See __filename.

clearImmediate(immediateObject)#

查看中文版

clearImmediate is described in the timers section.

clearInterval(intervalObject)#

查看中文版

clearInterval is described in the timers section.

clearTimeout(timeoutObject)#

查看中文版

clearTimeout is described in the timers section.

console#

查看中文版

Used to print to stdout and stderr. See the console section.

exports#

查看中文版

This variable may appear to be global but is not. See exports.

global#

查看中文版

In browsers, the top-level scope is the global scope. This means that within the browser var something will define a new global variable. In Node.js this is different. The top-level scope is not the global scope; var something inside a Node.js module will be local to that module.

module#

查看中文版

This variable may appear to be global but is not. See module.

process#

查看中文版

The process object. See the process object section.

require()#

查看中文版

This variable may appear to be global but is not. See require().

setImmediate(callback[, ...args])#

查看中文版

setImmediate is described in the timers section.

setInterval(callback, delay[, ...args])#

查看中文版

setInterval is described in the timers section.

setTimeout(callback, delay[, ...args])#

查看中文版

setTimeout is described in the timers section.