{ "type": "module", "source": "doc/api/globals.md", "introduced_in": "v0.10.0", "globals": [ { "textRaw": "Class: Buffer", "type": "global", "name": "Buffer", "meta": { "added": [ "v0.1.103" ], "changes": [] }, "desc": "\n

Used to handle binary data. See the buffer section.

" }, { "textRaw": "clearImmediate(immediateObject)", "type": "global", "name": "clearImmediate", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "desc": "

clearImmediate is described in the timers section.

" }, { "textRaw": "clearInterval(intervalObject)", "type": "global", "name": "clearInterval", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "desc": "

clearInterval is described in the timers section.

" }, { "textRaw": "clearTimeout(timeoutObject)", "type": "global", "name": "clearTimeout", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "desc": "

clearTimeout is described in the timers section.

" }, { "textRaw": "console", "name": "console", "meta": { "added": [ "v0.1.100" ], "changes": [] }, "type": "global", "desc": "\n

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

" }, { "textRaw": "global", "name": "global", "meta": { "added": [ "v0.1.27" ], "changes": [] }, "type": "global", "desc": "\n

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

" }, { "textRaw": "process", "name": "process", "meta": { "added": [ "v0.1.7" ], "changes": [] }, "type": "global", "desc": "\n

The process object. See the process object section.

" }, { "textRaw": "queueMicrotask(callback)", "type": "global", "name": "queueMicrotask", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "desc": "\n

The queueMicrotask() method queues a microtask to invoke callback. If\ncallback throws an exception, the process object 'uncaughtException'\nevent will be emitted.

\n

The microtask queue is managed by V8 and may be used in a similar manner to\nthe process.nextTick() queue, which is managed by Node.js. The\nprocess.nextTick() queue is always processed before the microtask queue\nwithin each turn of the Node.js event loop.

\n
// Here, `queueMicrotask()` is used to ensure the 'load' event is always\n// emitted asynchronously, and therefore consistently. Using\n// `process.nextTick()` here would result in the 'load' event always emitting\n// before any other promise jobs.\n\nDataHandler.prototype.load = async function load(key) {\n  const hit = this._cache.get(url);\n  if (hit !== undefined) {\n    queueMicrotask(() => {\n      this.emit('load', hit);\n    });\n    return;\n  }\n\n  const data = await fetchData(key);\n  this._cache.set(url, data);\n  this.emit('load', data);\n};\n
" }, { "textRaw": "setImmediate(callback[, ...args])", "type": "global", "name": "setImmediate", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "desc": "

setImmediate is described in the timers section.

" }, { "textRaw": "setInterval(callback, delay[, ...args])", "type": "global", "name": "setInterval", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "desc": "

setInterval is described in the timers section.

" }, { "textRaw": "setTimeout(callback, delay[, ...args])", "type": "global", "name": "setTimeout", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "desc": "

setTimeout is described in the timers section.

" }, { "textRaw": "TextDecoder", "name": "TextDecoder", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "type": "global", "desc": "

The WHATWG TextDecoder class. See the TextDecoder section.

" }, { "textRaw": "TextEncoder", "name": "TextEncoder", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "type": "global", "desc": "

The WHATWG TextEncoder class. See the TextEncoder section.

" }, { "textRaw": "URL", "name": "URL", "meta": { "added": [ "v10.0.0" ], "changes": [] }, "type": "global", "desc": "

The WHATWG URL class. See the URL section.

" }, { "textRaw": "URLSearchParams", "name": "URLSearchParams", "meta": { "added": [ "v10.0.0" ], "changes": [] }, "type": "global", "desc": "

The WHATWG URLSearchParams class. See the URLSearchParams section.

" }, { "textRaw": "WebAssembly", "name": "WebAssembly", "meta": { "added": [ "v8.0.0" ], "changes": [] }, "type": "global", "desc": "\n

The object that acts as the namespace for all W3C\nWebAssembly related functionality. See the\nMozilla Developer Network for usage and compatibility.

" } ], "methods": [ { "textRaw": "require()", "type": "method", "name": "require", "signatures": [ { "params": [] } ], "desc": "

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

" } ], "miscs": [ { "textRaw": "Global Objects", "name": "Global Objects", "introduced_in": "v0.10.0", "type": "misc", "desc": "

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

\n\n

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

", "globals": [ { "textRaw": "Class: Buffer", "type": "global", "name": "Buffer", "meta": { "added": [ "v0.1.103" ], "changes": [] }, "desc": "\n

Used to handle binary data. See the buffer section.

" }, { "textRaw": "clearImmediate(immediateObject)", "type": "global", "name": "clearImmediate", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "desc": "

clearImmediate is described in the timers section.

" }, { "textRaw": "clearInterval(intervalObject)", "type": "global", "name": "clearInterval", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "desc": "

clearInterval is described in the timers section.

" }, { "textRaw": "clearTimeout(timeoutObject)", "type": "global", "name": "clearTimeout", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "desc": "

clearTimeout is described in the timers section.

" }, { "textRaw": "console", "name": "console", "meta": { "added": [ "v0.1.100" ], "changes": [] }, "type": "global", "desc": "\n

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

" }, { "textRaw": "global", "name": "global", "meta": { "added": [ "v0.1.27" ], "changes": [] }, "type": "global", "desc": "\n

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

" }, { "textRaw": "process", "name": "process", "meta": { "added": [ "v0.1.7" ], "changes": [] }, "type": "global", "desc": "\n

The process object. See the process object section.

" }, { "textRaw": "queueMicrotask(callback)", "type": "global", "name": "queueMicrotask", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "desc": "\n

The queueMicrotask() method queues a microtask to invoke callback. If\ncallback throws an exception, the process object 'uncaughtException'\nevent will be emitted.

\n

The microtask queue is managed by V8 and may be used in a similar manner to\nthe process.nextTick() queue, which is managed by Node.js. The\nprocess.nextTick() queue is always processed before the microtask queue\nwithin each turn of the Node.js event loop.

\n
// Here, `queueMicrotask()` is used to ensure the 'load' event is always\n// emitted asynchronously, and therefore consistently. Using\n// `process.nextTick()` here would result in the 'load' event always emitting\n// before any other promise jobs.\n\nDataHandler.prototype.load = async function load(key) {\n  const hit = this._cache.get(url);\n  if (hit !== undefined) {\n    queueMicrotask(() => {\n      this.emit('load', hit);\n    });\n    return;\n  }\n\n  const data = await fetchData(key);\n  this._cache.set(url, data);\n  this.emit('load', data);\n};\n
" }, { "textRaw": "setImmediate(callback[, ...args])", "type": "global", "name": "setImmediate", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "desc": "

setImmediate is described in the timers section.

" }, { "textRaw": "setInterval(callback, delay[, ...args])", "type": "global", "name": "setInterval", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "desc": "

setInterval is described in the timers section.

" }, { "textRaw": "setTimeout(callback, delay[, ...args])", "type": "global", "name": "setTimeout", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "desc": "

setTimeout is described in the timers section.

" }, { "textRaw": "TextDecoder", "name": "TextDecoder", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "type": "global", "desc": "

The WHATWG TextDecoder class. See the TextDecoder section.

" }, { "textRaw": "TextEncoder", "name": "TextEncoder", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "type": "global", "desc": "

The WHATWG TextEncoder class. See the TextEncoder section.

" }, { "textRaw": "URL", "name": "URL", "meta": { "added": [ "v10.0.0" ], "changes": [] }, "type": "global", "desc": "

The WHATWG URL class. See the URL section.

" }, { "textRaw": "URLSearchParams", "name": "URLSearchParams", "meta": { "added": [ "v10.0.0" ], "changes": [] }, "type": "global", "desc": "

The WHATWG URLSearchParams class. See the URLSearchParams section.

" }, { "textRaw": "WebAssembly", "name": "WebAssembly", "meta": { "added": [ "v8.0.0" ], "changes": [] }, "type": "global", "desc": "\n

The object that acts as the namespace for all W3C\nWebAssembly related functionality. See the\nMozilla Developer Network for usage and compatibility.

" } ], "miscs": [ { "textRaw": "__dirname", "name": "__dirname", "desc": "

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

", "type": "misc", "displayName": "__dirname" }, { "textRaw": "__filename", "name": "__filename", "desc": "

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

", "type": "misc", "displayName": "__filename" }, { "textRaw": "exports", "name": "exports", "desc": "

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

", "type": "misc", "displayName": "exports" }, { "textRaw": "module", "name": "module", "desc": "

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

", "type": "misc", "displayName": "module" } ], "methods": [ { "textRaw": "require()", "type": "method", "name": "require", "signatures": [ { "params": [] } ], "desc": "

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

" } ] } ] }