{ "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": "
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.
clearInterval
is described in the timers section.
clearTimeout
is described in the timers section.
Used to print to stdout and stderr. See the console
section.
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.
The process object. See the process
object section.
callback
<Function> Function to be queued.The queueMicrotask()
method queues a microtask to invoke callback
. If\ncallback
throws an exception, the process
object 'uncaughtException'
\nevent will be emitted.
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.
// 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.
setInterval
is described in the timers section.
setTimeout
is described in the timers section.
The WHATWG TextDecoder
class. See the TextDecoder
section.
The WHATWG TextEncoder
class. See the TextEncoder
section.
The WHATWG URL
class. See the URL
section.
The WHATWG URLSearchParams
class. See the URLSearchParams
section.
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()
.
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__dirname
__filename
exports
module
require()
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": "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.
clearInterval
is described in the timers section.
clearTimeout
is described in the timers section.
Used to print to stdout and stderr. See the console
section.
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.
The process object. See the process
object section.
callback
<Function> Function to be queued.The queueMicrotask()
method queues a microtask to invoke callback
. If\ncallback
throws an exception, the process
object 'uncaughtException'
\nevent will be emitted.
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.
// 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.
setInterval
is described in the timers section.
setTimeout
is described in the timers section.
The WHATWG TextDecoder
class. See the TextDecoder
section.
The WHATWG TextEncoder
class. See the TextEncoder
section.
The WHATWG URL
class. See the URL
section.
The WHATWG URLSearchParams
class. See the URLSearchParams
section.
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
.
This variable may appear to be global but is not. See __filename
.
This variable may appear to be global but is not. See exports
.
This variable may appear to be global but is not. See module
.
This variable may appear to be global but is not. See require()
.