Current File : //proc/self/root/kunden/usr/share/doc/nodejs-docs/doc/api/globals.json |
{
"type": "module",
"source": "doc/api/globals.md",
"introduced_in": "v0.10.0",
"globals": [
{
"textRaw": "Class: `AbortController`",
"type": "global",
"name": "AbortController",
"meta": {
"added": [
"v15.0.0"
],
"changes": [
{
"version": "v15.4.0",
"pr-url": "https://github.com/nodejs/node/pull/35949",
"description": "No longer experimental."
}
]
},
"desc": "<p>A utility class used to signal cancelation in selected <code>Promise</code>-based APIs.\nThe API is based on the Web API <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/AbortController\"><code>AbortController</code></a>.</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\n\nac.signal.addEventListener('abort', () => console.log('Aborted!'),\n { once: true });\n\nac.abort();\n\nconsole.log(ac.signal.aborted); // Prints True\n</code></pre>",
"methods": [
{
"textRaw": "`abortController.abort([reason])`",
"type": "method",
"name": "abort",
"meta": {
"added": [
"v15.0.0",
"v14.17.0"
],
"changes": [
{
"version": "v16.14.0",
"pr-url": "https://github.com/nodejs/node/pull/40807",
"description": "Added the new optional reason argument."
}
]
},
"signatures": [
{
"params": [
{
"textRaw": "`reason` {any} An optional reason, retrievable on the `AbortSignal`'s `reason` property.",
"name": "reason",
"type": "any",
"desc": "An optional reason, retrievable on the `AbortSignal`'s `reason` property."
}
]
}
],
"desc": "<p>Triggers the abort signal, causing the <code>abortController.signal</code> to emit\nthe <code>'abort'</code> event.</p>"
}
],
"properties": [
{
"textRaw": "`signal` Type: {AbortSignal}",
"type": "AbortSignal",
"name": "Type",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
}
}
],
"classes": [
{
"textRaw": "Class: `AbortSignal`",
"type": "class",
"name": "AbortSignal",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventtarget\" class=\"type\"><EventTarget></a></li>\n</ul>\n<p>The <code>AbortSignal</code> is used to notify observers when the\n<code>abortController.abort()</code> method is called.</p>",
"classMethods": [
{
"textRaw": "Static method: `AbortSignal.abort([reason])`",
"type": "classMethod",
"name": "abort",
"meta": {
"added": [
"v15.12.0",
"v14.17.0"
],
"changes": [
{
"version": "v16.14.0",
"pr-url": "https://github.com/nodejs/node/pull/40807",
"description": "Added the new optional reason argument."
}
]
},
"signatures": [
{
"return": {
"textRaw": "Returns: {AbortSignal}",
"name": "return",
"type": "AbortSignal"
},
"params": [
{
"textRaw": "`reason`: {any}",
"name": "reason",
"type": "any"
}
]
}
],
"desc": "<p>Returns a new already aborted <code>AbortSignal</code>.</p>"
},
{
"textRaw": "Static method: `AbortSignal.timeout(delay)`",
"type": "classMethod",
"name": "timeout",
"meta": {
"added": [
"v16.14.0"
],
"changes": []
},
"signatures": [
{
"params": [
{
"textRaw": "`delay` {number} The number of milliseconds to wait before triggering the AbortSignal.",
"name": "delay",
"type": "number",
"desc": "The number of milliseconds to wait before triggering the AbortSignal."
}
]
}
],
"desc": "<p>Returns a new <code>AbortSignal</code> which will be aborted in <code>delay</code> milliseconds.</p>"
}
],
"events": [
{
"textRaw": "Event: `'abort'`",
"type": "event",
"name": "abort",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"params": [],
"desc": "<p>The <code>'abort'</code> event is emitted when the <code>abortController.abort()</code> method\nis called. The callback is invoked with a single object argument with a\nsingle <code>type</code> property set to <code>'abort'</code>:</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\n\n// Use either the onabort property...\nac.signal.onabort = () => console.log('aborted!');\n\n// Or the EventTarget API...\nac.signal.addEventListener('abort', (event) => {\n console.log(event.type); // Prints 'abort'\n}, { once: true });\n\nac.abort();\n</code></pre>\n<p>The <code>AbortController</code> with which the <code>AbortSignal</code> is associated will only\never trigger the <code>'abort'</code> event once. We recommended that code check\nthat the <code>abortSignal.aborted</code> attribute is <code>false</code> before adding an <code>'abort'</code>\nevent listener.</p>\n<p>Any event listeners attached to the <code>AbortSignal</code> should use the\n<code>{ once: true }</code> option (or, if using the <code>EventEmitter</code> APIs to attach a\nlistener, use the <code>once()</code> method) to ensure that the event listener is\nremoved as soon as the <code>'abort'</code> event is handled. Failure to do so may\nresult in memory leaks.</p>"
}
],
"properties": [
{
"textRaw": "`aborted` Type: {boolean} True after the `AbortController` has been aborted.",
"type": "boolean",
"name": "Type",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"desc": "True after the `AbortController` has been aborted."
},
{
"textRaw": "`onabort` Type: {Function}",
"type": "Function",
"name": "Type",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"desc": "<p>An optional callback function that may be set by user code to be notified\nwhen the <code>abortController.abort()</code> function has been called.</p>"
},
{
"textRaw": "`reason` Type: {any}",
"type": "any",
"name": "Type",
"meta": {
"added": [
"v16.14.0"
],
"changes": []
},
"desc": "<p>An optional reason specified when the <code>AbortSignal</code> was triggered.</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\nac.abort(new Error('boom!'));\nconsole.log(ac.signal.reason); // Error('boom!');\n</code></pre>"
}
],
"methods": [
{
"textRaw": "`abortSignal.throwIfAborted()`",
"type": "method",
"name": "throwIfAborted",
"meta": {
"added": [
"v16.17.0"
],
"changes": []
},
"signatures": [
{
"params": []
}
],
"desc": "<p>If <code>abortSignal.aborted</code> is <code>true</code>, throws <code>abortSignal.reason</code>.</p>"
}
]
}
]
},
{
"textRaw": "Class: `Buffer`",
"type": "global",
"name": "Buffer",
"meta": {
"added": [
"v0.1.103"
],
"changes": []
},
"desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\"><Function></a></li>\n</ul>\n<p>Used to handle binary data. See the <a href=\"buffer.html\">buffer section</a>.</p>"
},
{
"textRaw": "`clearImmediate(immediateObject)`",
"type": "global",
"name": "clearImmediate",
"meta": {
"added": [
"v0.9.1"
],
"changes": []
},
"desc": "<p><a href=\"timers.html#clearimmediateimmediate\"><code>clearImmediate</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
},
{
"textRaw": "`clearInterval(intervalObject)`",
"type": "global",
"name": "clearInterval",
"meta": {
"added": [
"v0.0.1"
],
"changes": []
},
"desc": "<p><a href=\"timers.html#clearintervaltimeout\"><code>clearInterval</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
},
{
"textRaw": "`clearTimeout(timeoutObject)`",
"type": "global",
"name": "clearTimeout",
"meta": {
"added": [
"v0.0.1"
],
"changes": []
},
"desc": "<p><a href=\"timers.html#cleartimeouttimeout\"><code>clearTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
},
{
"textRaw": "`console`",
"name": "`console`",
"meta": {
"added": [
"v0.1.100"
],
"changes": []
},
"type": "global",
"desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\"><Object></a></li>\n</ul>\n<p>Used to print to stdout and stderr. See the <a href=\"console.html\"><code>console</code></a> section.</p>"
},
{
"textRaw": "`CustomEvent`",
"name": "`CustomEvent`",
"meta": {
"added": [
"v16.17.0"
],
"changes": []
},
"stability": 1,
"stabilityText": "Experimental. Enable this API with the\n[`--experimental-global-customevent`][] CLI flag.",
"type": "global",
"desc": "<p>A browser-compatible implementation of the <a href=\"https://dom.spec.whatwg.org/#customevent\"><code>CustomEvent</code> Web API</a>.</p>"
},
{
"textRaw": "`Event`",
"name": "`Event`",
"meta": {
"added": [
"v15.0.0"
],
"changes": [
{
"version": "v15.4.0",
"pr-url": "https://github.com/nodejs/node/pull/35949",
"description": "No longer experimental."
}
]
},
"type": "global",
"desc": "<p>A browser-compatible implementation of the <code>Event</code> class. See\n<a href=\"events.html#eventtarget-and-event-api\"><code>EventTarget</code> and <code>Event</code> API</a> for more details.</p>"
},
{
"textRaw": "`EventTarget`",
"name": "`EventTarget`",
"meta": {
"added": [
"v15.0.0"
],
"changes": [
{
"version": "v15.4.0",
"pr-url": "https://github.com/nodejs/node/pull/35949",
"description": "No longer experimental."
}
]
},
"type": "global",
"desc": "<p>A browser-compatible implementation of the <code>EventTarget</code> class. See\n<a href=\"events.html#eventtarget-and-event-api\"><code>EventTarget</code> and <code>Event</code> API</a> for more details.</p>"
},
{
"textRaw": "`global`",
"name": "`global`",
"meta": {
"added": [
"v0.1.27"
],
"changes": []
},
"type": "global",
"desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\"><Object></a> The global namespace object.</li>\n</ul>\n<p>In browsers, the top-level scope is the global scope. This means that\nwithin the browser <code>var something</code> will define a new global variable. In\nNode.js this is different. The top-level scope is not the global scope;\n<code>var something</code> inside a Node.js module will be local to that module.</p>"
},
{
"textRaw": "`MessageChannel`",
"name": "`MessageChannel`",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The <code>MessageChannel</code> class. See <a href=\"worker_threads.html#class-messagechannel\"><code>MessageChannel</code></a> for more details.</p>"
},
{
"textRaw": "`MessageEvent`",
"name": "`MessageEvent`",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The <code>MessageEvent</code> class. See <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent/MessageEvent\"><code>MessageEvent</code></a> for more details.</p>"
},
{
"textRaw": "`MessagePort`",
"name": "`MessagePort`",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The <code>MessagePort</code> class. See <a href=\"worker_threads.html#class-messageport\"><code>MessagePort</code></a> for more details.</p>"
},
{
"textRaw": "`process`",
"name": "`process`",
"meta": {
"added": [
"v0.1.7"
],
"changes": []
},
"type": "global",
"desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\"><Object></a></li>\n</ul>\n<p>The process object. See the <a href=\"process.html#process\"><code>process</code> object</a> section.</p>"
},
{
"textRaw": "`queueMicrotask(callback)`",
"type": "global",
"name": "queueMicrotask",
"meta": {
"added": [
"v11.0.0"
],
"changes": []
},
"desc": "<ul>\n<li><code>callback</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\"><Function></a> Function to be queued.</li>\n</ul>\n<p>The <code>queueMicrotask()</code> method queues a microtask to invoke <code>callback</code>. If\n<code>callback</code> throws an exception, the <a href=\"process.html#process\"><code>process</code> object</a> <code>'uncaughtException'</code>\nevent will be emitted.</p>\n<p>The microtask queue is managed by V8 and may be used in a similar manner to\nthe <a href=\"process.html#processnexttickcallback-args\"><code>process.nextTick()</code></a> queue, which is managed by Node.js. The\n<code>process.nextTick()</code> queue is always processed before the microtask queue\nwithin each turn of the Node.js event loop.</p>\n<pre><code class=\"language-js\">// 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(key);\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(key, data);\n this.emit('load', data);\n};\n</code></pre>"
},
{
"textRaw": "`setImmediate(callback[, ...args])`",
"type": "global",
"name": "setImmediate",
"meta": {
"added": [
"v0.9.1"
],
"changes": []
},
"desc": "<p><a href=\"timers.html#setimmediatecallback-args\"><code>setImmediate</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
},
{
"textRaw": "`setInterval(callback, delay[, ...args])`",
"type": "global",
"name": "setInterval",
"meta": {
"added": [
"v0.0.1"
],
"changes": []
},
"desc": "<p><a href=\"timers.html#setintervalcallback-delay-args\"><code>setInterval</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
},
{
"textRaw": "`setTimeout(callback, delay[, ...args])`",
"type": "global",
"name": "setTimeout",
"meta": {
"added": [
"v0.0.1"
],
"changes": []
},
"desc": "<p><a href=\"timers.html#settimeoutcallback-delay-args\"><code>setTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
},
{
"textRaw": "`TextDecoder`",
"name": "`TextDecoder`",
"meta": {
"added": [
"v11.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The WHATWG <code>TextDecoder</code> class. See the <a href=\"util.html#class-utiltextdecoder\"><code>TextDecoder</code></a> section.</p>"
},
{
"textRaw": "`TextEncoder`",
"name": "`TextEncoder`",
"meta": {
"added": [
"v11.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The WHATWG <code>TextEncoder</code> class. See the <a href=\"util.html#class-utiltextencoder\"><code>TextEncoder</code></a> section.</p>"
},
{
"textRaw": "`URL`",
"name": "`URL`",
"meta": {
"added": [
"v10.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The WHATWG <code>URL</code> class. See the <a href=\"url.html#class-url\"><code>URL</code></a> section.</p>"
},
{
"textRaw": "`URLSearchParams`",
"name": "`URLSearchParams`",
"meta": {
"added": [
"v10.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The WHATWG <code>URLSearchParams</code> class. See the <a href=\"url.html#class-urlsearchparams\"><code>URLSearchParams</code></a> section.</p>"
},
{
"textRaw": "`WebAssembly`",
"name": "`WebAssembly`",
"meta": {
"added": [
"v8.0.0"
],
"changes": []
},
"type": "global",
"desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\"><Object></a></li>\n</ul>\n<p>The object that acts as the namespace for all W3C\n<a href=\"https://webassembly.org\">WebAssembly</a> related functionality. See the\n<a href=\"https://developer.mozilla.org/en-US/docs/WebAssembly\">Mozilla Developer Network</a> for usage and compatibility.</p>"
}
],
"methods": [
{
"textRaw": "`atob(data)`",
"type": "method",
"name": "atob",
"meta": {
"added": [
"v16.0.0"
],
"changes": []
},
"stability": 3,
"stabilityText": "Legacy. Use `Buffer.from(data, 'base64')` instead.",
"signatures": [
{
"params": []
}
],
"desc": "<p>Global alias for <a href=\"buffer.html#bufferatobdata\"><code>buffer.atob()</code></a>.</p>"
},
{
"textRaw": "`btoa(data)`",
"type": "method",
"name": "btoa",
"meta": {
"added": [
"v16.0.0"
],
"changes": []
},
"stability": 3,
"stabilityText": "Legacy. Use `buf.toString('base64')` instead.",
"signatures": [
{
"params": []
}
],
"desc": "<p>Global alias for <a href=\"buffer.html#bufferbtoadata\"><code>buffer.btoa()</code></a>.</p>"
},
{
"textRaw": "`require()`",
"type": "method",
"name": "require",
"signatures": [
{
"params": []
}
],
"desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#requireid\"><code>require()</code></a>.</p>"
}
],
"miscs": [
{
"textRaw": "Global objects",
"name": "Global objects",
"introduced_in": "v0.10.0",
"type": "misc",
"desc": "<p>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\n<a href=\"modules.html\">module system documentation</a>:</p>\n<ul>\n<li><a href=\"modules.html#__dirname\"><code>__dirname</code></a></li>\n<li><a href=\"modules.html#__filename\"><code>__filename</code></a></li>\n<li><a href=\"modules.html#exports\"><code>exports</code></a></li>\n<li><a href=\"modules.html#module\"><code>module</code></a></li>\n<li><a href=\"modules.html#requireid\"><code>require()</code></a></li>\n</ul>\n<p>The objects listed here are specific to Node.js. There are <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects\">built-in objects</a>\nthat are part of the JavaScript language itself, which are also globally\naccessible.</p>",
"globals": [
{
"textRaw": "Class: `AbortController`",
"type": "global",
"name": "AbortController",
"meta": {
"added": [
"v15.0.0"
],
"changes": [
{
"version": "v15.4.0",
"pr-url": "https://github.com/nodejs/node/pull/35949",
"description": "No longer experimental."
}
]
},
"desc": "<p>A utility class used to signal cancelation in selected <code>Promise</code>-based APIs.\nThe API is based on the Web API <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/AbortController\"><code>AbortController</code></a>.</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\n\nac.signal.addEventListener('abort', () => console.log('Aborted!'),\n { once: true });\n\nac.abort();\n\nconsole.log(ac.signal.aborted); // Prints True\n</code></pre>",
"methods": [
{
"textRaw": "`abortController.abort([reason])`",
"type": "method",
"name": "abort",
"meta": {
"added": [
"v15.0.0",
"v14.17.0"
],
"changes": [
{
"version": "v16.14.0",
"pr-url": "https://github.com/nodejs/node/pull/40807",
"description": "Added the new optional reason argument."
}
]
},
"signatures": [
{
"params": [
{
"textRaw": "`reason` {any} An optional reason, retrievable on the `AbortSignal`'s `reason` property.",
"name": "reason",
"type": "any",
"desc": "An optional reason, retrievable on the `AbortSignal`'s `reason` property."
}
]
}
],
"desc": "<p>Triggers the abort signal, causing the <code>abortController.signal</code> to emit\nthe <code>'abort'</code> event.</p>"
}
],
"properties": [
{
"textRaw": "`signal` Type: {AbortSignal}",
"type": "AbortSignal",
"name": "Type",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
}
}
],
"classes": [
{
"textRaw": "Class: `AbortSignal`",
"type": "class",
"name": "AbortSignal",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"desc": "<ul>\n<li>Extends: <a href=\"events.html#class-eventtarget\" class=\"type\"><EventTarget></a></li>\n</ul>\n<p>The <code>AbortSignal</code> is used to notify observers when the\n<code>abortController.abort()</code> method is called.</p>",
"classMethods": [
{
"textRaw": "Static method: `AbortSignal.abort([reason])`",
"type": "classMethod",
"name": "abort",
"meta": {
"added": [
"v15.12.0",
"v14.17.0"
],
"changes": [
{
"version": "v16.14.0",
"pr-url": "https://github.com/nodejs/node/pull/40807",
"description": "Added the new optional reason argument."
}
]
},
"signatures": [
{
"return": {
"textRaw": "Returns: {AbortSignal}",
"name": "return",
"type": "AbortSignal"
},
"params": [
{
"textRaw": "`reason`: {any}",
"name": "reason",
"type": "any"
}
]
}
],
"desc": "<p>Returns a new already aborted <code>AbortSignal</code>.</p>"
},
{
"textRaw": "Static method: `AbortSignal.timeout(delay)`",
"type": "classMethod",
"name": "timeout",
"meta": {
"added": [
"v16.14.0"
],
"changes": []
},
"signatures": [
{
"params": [
{
"textRaw": "`delay` {number} The number of milliseconds to wait before triggering the AbortSignal.",
"name": "delay",
"type": "number",
"desc": "The number of milliseconds to wait before triggering the AbortSignal."
}
]
}
],
"desc": "<p>Returns a new <code>AbortSignal</code> which will be aborted in <code>delay</code> milliseconds.</p>"
}
],
"events": [
{
"textRaw": "Event: `'abort'`",
"type": "event",
"name": "abort",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"params": [],
"desc": "<p>The <code>'abort'</code> event is emitted when the <code>abortController.abort()</code> method\nis called. The callback is invoked with a single object argument with a\nsingle <code>type</code> property set to <code>'abort'</code>:</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\n\n// Use either the onabort property...\nac.signal.onabort = () => console.log('aborted!');\n\n// Or the EventTarget API...\nac.signal.addEventListener('abort', (event) => {\n console.log(event.type); // Prints 'abort'\n}, { once: true });\n\nac.abort();\n</code></pre>\n<p>The <code>AbortController</code> with which the <code>AbortSignal</code> is associated will only\never trigger the <code>'abort'</code> event once. We recommended that code check\nthat the <code>abortSignal.aborted</code> attribute is <code>false</code> before adding an <code>'abort'</code>\nevent listener.</p>\n<p>Any event listeners attached to the <code>AbortSignal</code> should use the\n<code>{ once: true }</code> option (or, if using the <code>EventEmitter</code> APIs to attach a\nlistener, use the <code>once()</code> method) to ensure that the event listener is\nremoved as soon as the <code>'abort'</code> event is handled. Failure to do so may\nresult in memory leaks.</p>"
}
],
"properties": [
{
"textRaw": "`aborted` Type: {boolean} True after the `AbortController` has been aborted.",
"type": "boolean",
"name": "Type",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"desc": "True after the `AbortController` has been aborted."
},
{
"textRaw": "`onabort` Type: {Function}",
"type": "Function",
"name": "Type",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"desc": "<p>An optional callback function that may be set by user code to be notified\nwhen the <code>abortController.abort()</code> function has been called.</p>"
},
{
"textRaw": "`reason` Type: {any}",
"type": "any",
"name": "Type",
"meta": {
"added": [
"v16.14.0"
],
"changes": []
},
"desc": "<p>An optional reason specified when the <code>AbortSignal</code> was triggered.</p>\n<pre><code class=\"language-js\">const ac = new AbortController();\nac.abort(new Error('boom!'));\nconsole.log(ac.signal.reason); // Error('boom!');\n</code></pre>"
}
],
"methods": [
{
"textRaw": "`abortSignal.throwIfAborted()`",
"type": "method",
"name": "throwIfAborted",
"meta": {
"added": [
"v16.17.0"
],
"changes": []
},
"signatures": [
{
"params": []
}
],
"desc": "<p>If <code>abortSignal.aborted</code> is <code>true</code>, throws <code>abortSignal.reason</code>.</p>"
}
]
}
]
},
{
"textRaw": "Class: `Buffer`",
"type": "global",
"name": "Buffer",
"meta": {
"added": [
"v0.1.103"
],
"changes": []
},
"desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\"><Function></a></li>\n</ul>\n<p>Used to handle binary data. See the <a href=\"buffer.html\">buffer section</a>.</p>"
},
{
"textRaw": "`clearImmediate(immediateObject)`",
"type": "global",
"name": "clearImmediate",
"meta": {
"added": [
"v0.9.1"
],
"changes": []
},
"desc": "<p><a href=\"timers.html#clearimmediateimmediate\"><code>clearImmediate</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
},
{
"textRaw": "`clearInterval(intervalObject)`",
"type": "global",
"name": "clearInterval",
"meta": {
"added": [
"v0.0.1"
],
"changes": []
},
"desc": "<p><a href=\"timers.html#clearintervaltimeout\"><code>clearInterval</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
},
{
"textRaw": "`clearTimeout(timeoutObject)`",
"type": "global",
"name": "clearTimeout",
"meta": {
"added": [
"v0.0.1"
],
"changes": []
},
"desc": "<p><a href=\"timers.html#cleartimeouttimeout\"><code>clearTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
},
{
"textRaw": "`console`",
"name": "`console`",
"meta": {
"added": [
"v0.1.100"
],
"changes": []
},
"type": "global",
"desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\"><Object></a></li>\n</ul>\n<p>Used to print to stdout and stderr. See the <a href=\"console.html\"><code>console</code></a> section.</p>"
},
{
"textRaw": "`CustomEvent`",
"name": "`CustomEvent`",
"meta": {
"added": [
"v16.17.0"
],
"changes": []
},
"stability": 1,
"stabilityText": "Experimental. Enable this API with the\n[`--experimental-global-customevent`][] CLI flag.",
"type": "global",
"desc": "<p>A browser-compatible implementation of the <a href=\"https://dom.spec.whatwg.org/#customevent\"><code>CustomEvent</code> Web API</a>.</p>"
},
{
"textRaw": "`Event`",
"name": "`Event`",
"meta": {
"added": [
"v15.0.0"
],
"changes": [
{
"version": "v15.4.0",
"pr-url": "https://github.com/nodejs/node/pull/35949",
"description": "No longer experimental."
}
]
},
"type": "global",
"desc": "<p>A browser-compatible implementation of the <code>Event</code> class. See\n<a href=\"events.html#eventtarget-and-event-api\"><code>EventTarget</code> and <code>Event</code> API</a> for more details.</p>"
},
{
"textRaw": "`EventTarget`",
"name": "`EventTarget`",
"meta": {
"added": [
"v15.0.0"
],
"changes": [
{
"version": "v15.4.0",
"pr-url": "https://github.com/nodejs/node/pull/35949",
"description": "No longer experimental."
}
]
},
"type": "global",
"desc": "<p>A browser-compatible implementation of the <code>EventTarget</code> class. See\n<a href=\"events.html#eventtarget-and-event-api\"><code>EventTarget</code> and <code>Event</code> API</a> for more details.</p>"
},
{
"textRaw": "`global`",
"name": "`global`",
"meta": {
"added": [
"v0.1.27"
],
"changes": []
},
"type": "global",
"desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\"><Object></a> The global namespace object.</li>\n</ul>\n<p>In browsers, the top-level scope is the global scope. This means that\nwithin the browser <code>var something</code> will define a new global variable. In\nNode.js this is different. The top-level scope is not the global scope;\n<code>var something</code> inside a Node.js module will be local to that module.</p>"
},
{
"textRaw": "`MessageChannel`",
"name": "`MessageChannel`",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The <code>MessageChannel</code> class. See <a href=\"worker_threads.html#class-messagechannel\"><code>MessageChannel</code></a> for more details.</p>"
},
{
"textRaw": "`MessageEvent`",
"name": "`MessageEvent`",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The <code>MessageEvent</code> class. See <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent/MessageEvent\"><code>MessageEvent</code></a> for more details.</p>"
},
{
"textRaw": "`MessagePort`",
"name": "`MessagePort`",
"meta": {
"added": [
"v15.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The <code>MessagePort</code> class. See <a href=\"worker_threads.html#class-messageport\"><code>MessagePort</code></a> for more details.</p>"
},
{
"textRaw": "`process`",
"name": "`process`",
"meta": {
"added": [
"v0.1.7"
],
"changes": []
},
"type": "global",
"desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\"><Object></a></li>\n</ul>\n<p>The process object. See the <a href=\"process.html#process\"><code>process</code> object</a> section.</p>"
},
{
"textRaw": "`queueMicrotask(callback)`",
"type": "global",
"name": "queueMicrotask",
"meta": {
"added": [
"v11.0.0"
],
"changes": []
},
"desc": "<ul>\n<li><code>callback</code> <a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function\" class=\"type\"><Function></a> Function to be queued.</li>\n</ul>\n<p>The <code>queueMicrotask()</code> method queues a microtask to invoke <code>callback</code>. If\n<code>callback</code> throws an exception, the <a href=\"process.html#process\"><code>process</code> object</a> <code>'uncaughtException'</code>\nevent will be emitted.</p>\n<p>The microtask queue is managed by V8 and may be used in a similar manner to\nthe <a href=\"process.html#processnexttickcallback-args\"><code>process.nextTick()</code></a> queue, which is managed by Node.js. The\n<code>process.nextTick()</code> queue is always processed before the microtask queue\nwithin each turn of the Node.js event loop.</p>\n<pre><code class=\"language-js\">// 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(key);\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(key, data);\n this.emit('load', data);\n};\n</code></pre>"
},
{
"textRaw": "`setImmediate(callback[, ...args])`",
"type": "global",
"name": "setImmediate",
"meta": {
"added": [
"v0.9.1"
],
"changes": []
},
"desc": "<p><a href=\"timers.html#setimmediatecallback-args\"><code>setImmediate</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
},
{
"textRaw": "`setInterval(callback, delay[, ...args])`",
"type": "global",
"name": "setInterval",
"meta": {
"added": [
"v0.0.1"
],
"changes": []
},
"desc": "<p><a href=\"timers.html#setintervalcallback-delay-args\"><code>setInterval</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
},
{
"textRaw": "`setTimeout(callback, delay[, ...args])`",
"type": "global",
"name": "setTimeout",
"meta": {
"added": [
"v0.0.1"
],
"changes": []
},
"desc": "<p><a href=\"timers.html#settimeoutcallback-delay-args\"><code>setTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>"
},
{
"textRaw": "`TextDecoder`",
"name": "`TextDecoder`",
"meta": {
"added": [
"v11.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The WHATWG <code>TextDecoder</code> class. See the <a href=\"util.html#class-utiltextdecoder\"><code>TextDecoder</code></a> section.</p>"
},
{
"textRaw": "`TextEncoder`",
"name": "`TextEncoder`",
"meta": {
"added": [
"v11.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The WHATWG <code>TextEncoder</code> class. See the <a href=\"util.html#class-utiltextencoder\"><code>TextEncoder</code></a> section.</p>"
},
{
"textRaw": "`URL`",
"name": "`URL`",
"meta": {
"added": [
"v10.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The WHATWG <code>URL</code> class. See the <a href=\"url.html#class-url\"><code>URL</code></a> section.</p>"
},
{
"textRaw": "`URLSearchParams`",
"name": "`URLSearchParams`",
"meta": {
"added": [
"v10.0.0"
],
"changes": []
},
"type": "global",
"desc": "<p>The WHATWG <code>URLSearchParams</code> class. See the <a href=\"url.html#class-urlsearchparams\"><code>URLSearchParams</code></a> section.</p>"
},
{
"textRaw": "`WebAssembly`",
"name": "`WebAssembly`",
"meta": {
"added": [
"v8.0.0"
],
"changes": []
},
"type": "global",
"desc": "<ul>\n<li><a href=\"https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object\" class=\"type\"><Object></a></li>\n</ul>\n<p>The object that acts as the namespace for all W3C\n<a href=\"https://webassembly.org\">WebAssembly</a> related functionality. See the\n<a href=\"https://developer.mozilla.org/en-US/docs/WebAssembly\">Mozilla Developer Network</a> for usage and compatibility.</p>"
}
],
"miscs": [
{
"textRaw": "`__dirname`",
"name": "`__dirname`",
"desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#__dirname\"><code>__dirname</code></a>.</p>",
"type": "misc",
"displayName": "`__dirname`"
},
{
"textRaw": "`__filename`",
"name": "`__filename`",
"desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#__filename\"><code>__filename</code></a>.</p>",
"type": "misc",
"displayName": "`__filename`"
},
{
"textRaw": "`Crypto`",
"name": "`crypto`",
"meta": {
"added": [
"v16.15.0"
],
"changes": []
},
"stability": 1,
"stabilityText": "Experimental. Enable this API with the\n[`--experimental-global-webcrypto`][] CLI flag.",
"desc": "<p>A browser-compatible implementation of <a href=\"webcrypto.html#class-crypto\" class=\"type\"><Crypto></a>. This global is available\nonly if the Node.js binary was compiled with including support for the\n<code>node:crypto</code> module.</p>",
"type": "misc",
"displayName": "`Crypto`"
},
{
"textRaw": "`crypto`",
"name": "`crypto`",
"meta": {
"added": [
"v16.15.0"
],
"changes": []
},
"stability": 1,
"stabilityText": "Experimental. Enable this API with the\n[`--experimental-global-webcrypto`][] CLI flag.",
"desc": "<p>A browser-compatible implementation of the <a href=\"webcrypto.html\">Web Crypto API</a>.</p>",
"type": "misc",
"displayName": "`crypto`"
},
{
"textRaw": "`CryptoKey`",
"name": "`cryptokey`",
"meta": {
"added": [
"v16.15.0"
],
"changes": []
},
"stability": 1,
"stabilityText": "Experimental. Enable this API with the\n[`--experimental-global-webcrypto`][] CLI flag.",
"desc": "<p>A browser-compatible implementation of <a href=\"webcrypto.html#class-cryptokey\" class=\"type\"><CryptoKey></a>. This global is available\nonly if the Node.js binary was compiled with including support for the\n<code>node:crypto</code> module.</p>",
"type": "misc",
"displayName": "`CryptoKey`"
},
{
"textRaw": "`exports`",
"name": "`exports`",
"desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#exports\"><code>exports</code></a>.</p>",
"type": "misc",
"displayName": "`exports`"
},
{
"textRaw": "`fetch`",
"name": "`fetch`",
"meta": {
"added": [
"v16.15.0"
],
"changes": []
},
"stability": 1,
"stabilityText": "Experimental. Enable this API with the [`--experimental-fetch`][]\nCLI flag.",
"desc": "<p>A browser-compatible implementation of the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/fetch\"><code>fetch()</code></a> function.</p>",
"type": "misc",
"displayName": "`fetch`"
},
{
"textRaw": "Class `FormData`",
"name": "class_`formdata`",
"meta": {
"added": [
"v16.15.0"
],
"changes": []
},
"stability": 1,
"stabilityText": "Experimental. Enable this API with the [`--experimental-fetch`][]\nCLI flag.",
"desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/FormData\" class=\"type\"><FormData></a>.</p>",
"type": "misc",
"displayName": "Class `FormData`"
},
{
"textRaw": "Class `Headers`",
"name": "class_`headers`",
"meta": {
"added": [
"v16.15.0"
],
"changes": []
},
"stability": 1,
"stabilityText": "Experimental. Enable this API with the [`--experimental-fetch`][]\nCLI flag.",
"desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Headers\" class=\"type\"><Headers></a>.</p>",
"type": "misc",
"displayName": "Class `Headers`"
},
{
"textRaw": "`module`",
"name": "`module`",
"desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#module\"><code>module</code></a>.</p>",
"type": "misc",
"displayName": "`module`"
},
{
"textRaw": "`performance`",
"name": "`performance`",
"meta": {
"added": [
"v16.0.0"
],
"changes": []
},
"desc": "<p>The <a href=\"perf_hooks.html#perf_hooksperformance\"><code>perf_hooks.performance</code></a> object.</p>",
"type": "misc",
"displayName": "`performance`"
},
{
"textRaw": "`Response`",
"name": "`response`",
"meta": {
"added": [
"v16.15.0"
],
"changes": []
},
"stability": 1,
"stabilityText": "Experimental. Enable this API with the [`--experimental-fetch`][]\nCLI flag.",
"desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Response\" class=\"type\"><Response></a>.</p>",
"type": "misc",
"displayName": "`Response`"
},
{
"textRaw": "`Request`",
"name": "`request`",
"meta": {
"added": [
"v16.15.0"
],
"changes": []
},
"stability": 1,
"stabilityText": "Experimental. Enable this API with the [`--experimental-fetch`][]\nCLI flag.",
"desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Request\" class=\"type\"><Request></a>.</p>",
"type": "misc",
"displayName": "`Request`"
},
{
"textRaw": "`SubtleCrypto`",
"name": "`subtlecrypto`",
"meta": {
"added": [
"v16.15.0"
],
"changes": []
},
"stability": 1,
"stabilityText": "Experimental. Enable this API with the\n[`--experimental-global-webcrypto`][] CLI flag.",
"desc": "<p>A browser-compatible implementation of <a href=\"webcrypto.html#class-subtlecrypto\" class=\"type\"><SubtleCrypto></a>. This global is available\nonly if the Node.js binary was compiled with including support for the\n<code>node:crypto</code> module.</p>",
"type": "misc",
"displayName": "`SubtleCrypto`"
}
],
"methods": [
{
"textRaw": "`atob(data)`",
"type": "method",
"name": "atob",
"meta": {
"added": [
"v16.0.0"
],
"changes": []
},
"stability": 3,
"stabilityText": "Legacy. Use `Buffer.from(data, 'base64')` instead.",
"signatures": [
{
"params": []
}
],
"desc": "<p>Global alias for <a href=\"buffer.html#bufferatobdata\"><code>buffer.atob()</code></a>.</p>"
},
{
"textRaw": "`btoa(data)`",
"type": "method",
"name": "btoa",
"meta": {
"added": [
"v16.0.0"
],
"changes": []
},
"stability": 3,
"stabilityText": "Legacy. Use `buf.toString('base64')` instead.",
"signatures": [
{
"params": []
}
],
"desc": "<p>Global alias for <a href=\"buffer.html#bufferbtoadata\"><code>buffer.btoa()</code></a>.</p>"
},
{
"textRaw": "`require()`",
"type": "method",
"name": "require",
"signatures": [
{
"params": []
}
],
"desc": "<p>This variable may appear to be global but is not. See <a href=\"modules.html#requireid\"><code>require()</code></a>.</p>"
}
]
}
]
}