📁 File Manager Pro
v10.0.3 | PHP: 8.1.34
Server: Apache
2026-06-22 20:13:19
📂
/ (Root)
/
opt
/
alt
/
alt-nodejs24
/
root
/
usr
/
share
/
doc
/
alt-nodejs24-nodejs-docs-24.15.0
/
html
/
api
📍 /opt/alt/alt-nodejs24/root/usr/share/doc/alt-nodejs24-nodejs-docs-24.15.0/html/api
🔄 Refresh
✏️
Editing: globals.json
Read Only
{ "type": "module", "source": "doc/api/globals.md", "introduced_in": "v0.10.0", "stability": 2, "stabilityText": "Stable", "classes": [ { "textRaw": "Class: `AbortController`", "type": "class", "name": "AbortController", "meta": { "added": [ "v15.0.0", "v14.17.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=\"globals.html#class-abortcontroller\" class=\"type\"><AbortController></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": [ "v17.2.0", "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", "v14.17.0" ], "changes": [] } } ] }, { "textRaw": "Class: `AbortSignal`", "type": "class", "name": "AbortSignal", "meta": { "added": [ "v15.0.0", "v14.17.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": [ "v17.2.0", "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": [ "v17.3.0", "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>" }, { "textRaw": "Static method: `AbortSignal.any(signals)`", "type": "classMethod", "name": "any", "meta": { "added": [ "v20.3.0", "v18.17.0" ], "changes": [] }, "signatures": [ { "params": [ { "textRaw": "`signals` {AbortSignal\\[]} The `AbortSignal`s of which to compose a new `AbortSignal`.", "name": "signals", "type": "AbortSignal\\[]", "desc": "The `AbortSignal`s of which to compose a new `AbortSignal`." } ] } ], "desc": "<p>Returns a new <code>AbortSignal</code> which will be aborted if any of the provided\nsignals are aborted. Its <a href=\"#abortsignalreason\"><code>abortSignal.reason</code></a> will be set to whichever\none of the <code>signals</code> caused it to be aborted.</p>" } ], "events": [ { "textRaw": "Event: `'abort'`", "type": "event", "name": "abort", "meta": { "added": [ "v15.0.0", "v14.17.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}", "type": "boolean", "name": "Type", "meta": { "added": [ "v15.0.0", "v14.17.0" ], "changes": [] }, "desc": "<p>True after the <code>AbortController</code> has been aborted.</p>" }, { "textRaw": "`onabort` Type: {Function}", "type": "Function", "name": "Type", "meta": { "added": [ "v15.0.0", "v14.17.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": [ "v17.2.0", "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": [ "v17.3.0", "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: `Blob`", "type": "class", "name": "Blob", "meta": { "added": [ "v18.0.0" ], "changes": [] }, "desc": "<p>See <a href=\"buffer.html#class-blob\" class=\"type\"><Blob></a>.</p>" }, { "textRaw": "Class: `BroadcastChannel`", "type": "class", "name": "BroadcastChannel", "meta": { "added": [ "v18.0.0" ], "changes": [] }, "desc": "<p>See <a href=\"worker_threads.html#class-broadcastchannel-extends-eventtarget\" class=\"type\"><BroadcastChannel></a>.</p>" }, { "textRaw": "Class: `Buffer`", "type": "class", "name": "Buffer", "meta": { "added": [ "v0.1.103" ], "changes": [] }, "desc": "<ul>\n<li>Type: <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": "Class: `ByteLengthQueuingStrategy`", "type": "class", "name": "ByteLengthQueuingStrategy", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-bytelengthqueuingstrategy\"><code>ByteLengthQueuingStrategy</code></a>.</p>" }, { "textRaw": "Class: `CloseEvent`", "type": "class", "name": "CloseEvent", "meta": { "added": [ "v23.0.0" ], "changes": [] }, "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent\" class=\"type\"><CloseEvent></a>. Disable this API\nwith the <a href=\"cli.html#--no-experimental-websocket\"><code>--no-experimental-websocket</code></a> CLI flag.</p>" }, { "textRaw": "Class: `CompressionStream`", "type": "class", "name": "CompressionStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": "v24.7.0", "pr-url": "https://github.com/nodejs/node/pull/59464", "description": "format now accepts `brotli` value." }, { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-compressionstream\"><code>CompressionStream</code></a>.</p>" }, { "textRaw": "Class: `CountQueuingStrategy`", "type": "class", "name": "CountQueuingStrategy", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-countqueuingstrategy\"><code>CountQueuingStrategy</code></a>.</p>" }, { "textRaw": "Class: `Crypto`", "type": "class", "name": "Crypto", "meta": { "added": [ "v17.6.0", "v16.15.0" ], "changes": [ { "version": "v23.0.0", "pr-url": "https://github.com/nodejs/node/pull/52564", "description": "No longer experimental." }, { "version": "v19.0.0", "pr-url": "https://github.com/nodejs/node/pull/42083", "description": "No longer behind `--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>" }, { "textRaw": "Class: `CryptoKey`", "type": "class", "name": "CryptoKey", "meta": { "added": [ "v17.6.0", "v16.15.0" ], "changes": [ { "version": "v23.0.0", "pr-url": "https://github.com/nodejs/node/pull/52564", "description": "No longer experimental." }, { "version": "v19.0.0", "pr-url": "https://github.com/nodejs/node/pull/42083", "description": "No longer behind `--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>" }, { "textRaw": "Class: `CustomEvent`", "type": "class", "name": "CustomEvent", "meta": { "added": [ "v18.7.0", "v16.17.0" ], "changes": [ { "version": "v23.0.0", "pr-url": "https://github.com/nodejs/node/pull/52723", "description": "No longer experimental." }, { "version": [ "v22.1.0", "v20.13.0" ], "pr-url": "https://github.com/nodejs/node/pull/52618", "description": "CustomEvent is now stable." }, { "version": "v19.0.0", "pr-url": "https://github.com/nodejs/node/pull/44860", "description": "No longer behind `--experimental-global-customevent` CLI flag." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"events.html#class-customevent\" class=\"type\"><CustomEvent></a>.</p>" }, { "textRaw": "Class: `DecompressionStream`", "type": "class", "name": "DecompressionStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": "v24.7.0", "pr-url": "https://github.com/nodejs/node/pull/59464", "description": "format now accepts `brotli` value." }, { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-decompressionstream\"><code>DecompressionStream</code></a>.</p>" }, { "textRaw": "Class: `DOMException`", "type": "class", "name": "DOMException", "meta": { "added": [ "v17.0.0" ], "changes": [] }, "desc": "<p>The WHATWG <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/DOMException\" class=\"type\"><DOMException></a> class.</p>" }, { "textRaw": "Class: `Event`", "type": "class", "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." } ] }, "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": "Class: `EventSource`", "type": "class", "name": "EventSource", "meta": { "added": [ "v22.3.0", "v20.18.0" ], "changes": [] }, "stability": 1, "stabilityText": "Experimental. Enable this API with the [`--experimental-eventsource`][] CLI flag.", "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/EventSource\" class=\"type\"><EventSource></a>.</p>" }, { "textRaw": "Class: `EventTarget`", "type": "class", "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." } ] }, "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": "Class: `File`", "type": "class", "name": "File", "meta": { "added": [ "v20.0.0" ], "changes": [] }, "desc": "<p>See <a href=\"buffer.html#class-file\" class=\"type\"><File></a>.</p>" }, { "textRaw": "Class: `FormData`", "type": "class", "name": "FormData", "meta": { "added": [ "v17.6.0", "v16.15.0" ], "changes": [ { "version": [ "v21.0.0" ], "pr-url": "https://github.com/nodejs/node/pull/45684", "description": "No longer experimental." }, { "version": "v18.0.0", "pr-url": "https://github.com/nodejs/node/pull/41811", "description": "No longer behind `--experimental-fetch` CLI 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>" }, { "textRaw": "Class: `Headers`", "type": "class", "name": "Headers", "meta": { "added": [ "v17.5.0", "v16.15.0" ], "changes": [ { "version": [ "v21.0.0" ], "pr-url": "https://github.com/nodejs/node/pull/45684", "description": "No longer experimental." }, { "version": "v18.0.0", "pr-url": "https://github.com/nodejs/node/pull/41811", "description": "No longer behind `--experimental-fetch` CLI 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>" }, { "textRaw": "Class: `MessageChannel`", "type": "class", "name": "MessageChannel", "meta": { "added": [ "v15.0.0" ], "changes": [] }, "desc": "<p>The <code>MessageChannel</code> class. See <a href=\"worker_threads.html#class-messagechannel\"><code>MessageChannel</code></a> for more details.</p>" }, { "textRaw": "Class: `MessageEvent`", "type": "class", "name": "MessageEvent", "meta": { "added": [ "v15.0.0" ], "changes": [] }, "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent\" class=\"type\"><MessageEvent></a>.</p>" }, { "textRaw": "Class: `MessagePort`", "type": "class", "name": "MessagePort", "meta": { "added": [ "v15.0.0" ], "changes": [] }, "desc": "<p>The <code>MessagePort</code> class. See <a href=\"worker_threads.html#class-messageport\"><code>MessagePort</code></a> for more details.</p>" }, { "textRaw": "Class: `Navigator`", "type": "class", "name": "Navigator", "meta": { "added": [ "v21.0.0" ], "changes": [] }, "stability": 1, "stabilityText": ".1 - Active development. Disable this API with the [`--no-experimental-global-navigator`][] CLI flag.", "desc": "<p>A partial implementation of the <a href=\"https://html.spec.whatwg.org/multipage/system-state.html#the-navigator-object\">Navigator API</a>.</p>" }, { "textRaw": "Class: `PerformanceEntry`", "type": "class", "name": "PerformanceEntry", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "<p>The <code>PerformanceEntry</code> class. See <a href=\"perf_hooks.html#class-performanceentry\"><code>PerformanceEntry</code></a> for more details.</p>" }, { "textRaw": "Class: `PerformanceMark`", "type": "class", "name": "PerformanceMark", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "<p>The <code>PerformanceMark</code> class. See <a href=\"perf_hooks.html#class-performancemark\"><code>PerformanceMark</code></a> for more details.</p>" }, { "textRaw": "Class: `PerformanceMeasure`", "type": "class", "name": "PerformanceMeasure", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "<p>The <code>PerformanceMeasure</code> class. See <a href=\"perf_hooks.html#class-performancemeasure\"><code>PerformanceMeasure</code></a> for more details.</p>" }, { "textRaw": "Class: `PerformanceObserver`", "type": "class", "name": "PerformanceObserver", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "<p>The <code>PerformanceObserver</code> class. See <a href=\"perf_hooks.html#class-performanceobserver\"><code>PerformanceObserver</code></a> for more details.</p>" }, { "textRaw": "Class: `PerformanceObserverEntryList`", "type": "class", "name": "PerformanceObserverEntryList", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "<p>The <code>PerformanceObserverEntryList</code> class. See\n<a href=\"perf_hooks.html#class-performanceobserverentrylist\"><code>PerformanceObserverEntryList</code></a> for more details.</p>" }, { "textRaw": "Class: `PerformanceResourceTiming`", "type": "class", "name": "PerformanceResourceTiming", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "<p>The <code>PerformanceResourceTiming</code> class. See <a href=\"perf_hooks.html#class-performanceresourcetiming\"><code>PerformanceResourceTiming</code></a> for\nmore details.</p>" }, { "textRaw": "Class: `ReadableByteStreamController`", "type": "class", "name": "ReadableByteStreamController", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablebytestreamcontroller\"><code>ReadableByteStreamController</code></a>.</p>" }, { "textRaw": "Class: `ReadableStream`", "type": "class", "name": "ReadableStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestream\"><code>ReadableStream</code></a>.</p>" }, { "textRaw": "Class: `ReadableStreamBYOBReader`", "type": "class", "name": "ReadableStreamBYOBReader", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreambyobreader\"><code>ReadableStreamBYOBReader</code></a>.</p>" }, { "textRaw": "Class: `ReadableStreamBYOBRequest`", "type": "class", "name": "ReadableStreamBYOBRequest", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreambyobrequest\"><code>ReadableStreamBYOBRequest</code></a>.</p>" }, { "textRaw": "Class: `ReadableStreamDefaultController`", "type": "class", "name": "ReadableStreamDefaultController", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreamdefaultcontroller\"><code>ReadableStreamDefaultController</code></a>.</p>" }, { "textRaw": "Class: `ReadableStreamDefaultReader`", "type": "class", "name": "ReadableStreamDefaultReader", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreamdefaultreader\"><code>ReadableStreamDefaultReader</code></a>.</p>" }, { "textRaw": "Class: `Request`", "type": "class", "name": "Request", "meta": { "added": [ "v17.5.0", "v16.15.0" ], "changes": [ { "version": [ "v21.0.0" ], "pr-url": "https://github.com/nodejs/node/pull/45684", "description": "No longer experimental." }, { "version": "v18.0.0", "pr-url": "https://github.com/nodejs/node/pull/41811", "description": "No longer behind `--experimental-fetch` CLI 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>" }, { "textRaw": "Class: `Response`", "type": "class", "name": "Response", "meta": { "added": [ "v17.5.0", "v16.15.0" ], "changes": [ { "version": [ "v21.0.0" ], "pr-url": "https://github.com/nodejs/node/pull/45684", "description": "No longer experimental." }, { "version": "v18.0.0", "pr-url": "https://github.com/nodejs/node/pull/41811", "description": "No longer behind `--experimental-fetch` CLI 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>" }, { "textRaw": "Class: `Storage`", "type": "class", "name": "Storage", "meta": { "added": [ "v22.4.0" ], "changes": [] }, "stability": 1, "stabilityText": ".2 - Release candidate. Enable this API with [`--experimental-webstorage`][].", "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Storage\" class=\"type\"><Storage></a>.</p>" }, { "textRaw": "Class: `SubtleCrypto`", "type": "class", "name": "SubtleCrypto", "meta": { "added": [ "v17.6.0", "v16.15.0" ], "changes": [ { "version": "v19.0.0", "pr-url": "https://github.com/nodejs/node/pull/42083", "description": "No longer behind `--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>" }, { "textRaw": "Class: `TextDecoder`", "type": "class", "name": "TextDecoder", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "desc": "<p>The WHATWG <code>TextDecoder</code> class. See the <a href=\"util.html#class-utiltextdecoder\"><code>TextDecoder</code></a> section.</p>" }, { "textRaw": "Class: `TextDecoderStream`", "type": "class", "name": "TextDecoderStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-textdecoderstream\"><code>TextDecoderStream</code></a>.</p>" }, { "textRaw": "Class: `TextEncoder`", "type": "class", "name": "TextEncoder", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "desc": "<p>The WHATWG <code>TextEncoder</code> class. See the <a href=\"util.html#class-utiltextencoder\"><code>TextEncoder</code></a> section.</p>" }, { "textRaw": "Class: `TextEncoderStream`", "type": "class", "name": "TextEncoderStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-textencoderstream\"><code>TextEncoderStream</code></a>.</p>" }, { "textRaw": "Class: `TransformStream`", "type": "class", "name": "TransformStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-transformstream\"><code>TransformStream</code></a>.</p>" }, { "textRaw": "Class: `TransformStreamDefaultController`", "type": "class", "name": "TransformStreamDefaultController", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-transformstreamdefaultcontroller\"><code>TransformStreamDefaultController</code></a>.</p>" }, { "textRaw": "Class: `URL`", "type": "class", "name": "URL", "meta": { "added": [ "v10.0.0" ], "changes": [] }, "desc": "<p>The WHATWG <code>URL</code> class. See the <a href=\"url.html#class-url\"><code>URL</code></a> section.</p>" }, { "textRaw": "Class: `URLPattern`", "type": "class", "name": "URLPattern", "meta": { "added": [ "v24.0.0" ], "changes": [] }, "stability": 1, "stabilityText": "Experimental", "desc": "<p>The WHATWG <code>URLPattern</code> class. See the <a href=\"url.html#class-urlpattern\"><code>URLPattern</code></a> section.</p>" }, { "textRaw": "Class: `URLSearchParams`", "type": "class", "name": "URLSearchParams", "meta": { "added": [ "v10.0.0" ], "changes": [] }, "desc": "<p>The WHATWG <code>URLSearchParams</code> class. See the <a href=\"url.html#class-urlsearchparams\"><code>URLSearchParams</code></a> section.</p>" }, { "textRaw": "Class: `WebAssembly`", "type": "class", "name": "WebAssembly", "meta": { "added": [ "v8.0.0" ], "changes": [] }, "desc": "<ul>\n<li>Type: <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>" }, { "textRaw": "Class: `WebSocket`", "type": "class", "name": "WebSocket", "meta": { "added": [ "v21.0.0", "v20.10.0" ], "changes": [ { "version": "v22.4.0", "pr-url": "https://github.com/nodejs/node/pull/53352", "description": "No longer experimental." }, { "version": "v22.0.0", "pr-url": "https://github.com/nodejs/node/pull/51594", "description": "No longer behind `--experimental-websocket` CLI flag." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\" class=\"type\"><WebSocket></a>. Disable this API\nwith the <a href=\"cli.html#--no-experimental-websocket\"><code>--no-experimental-websocket</code></a> CLI flag.</p>" }, { "textRaw": "Class: `WritableStream`", "type": "class", "name": "WritableStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-writablestream\"><code>WritableStream</code></a>.</p>" }, { "textRaw": "Class: `WritableStreamDefaultController`", "type": "class", "name": "WritableStreamDefaultController", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-writablestreamdefaultcontroller\"><code>WritableStreamDefaultController</code></a>.</p>" }, { "textRaw": "Class: `WritableStreamDefaultWriter`", "type": "class", "name": "WritableStreamDefaultWriter", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-writablestreamdefaultwriter\"><code>WritableStreamDefaultWriter</code></a>.</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>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/buffer-atob-btoa\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/buffer-atob-btoa\n</code></pre>" }, { "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>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/buffer-atob-btoa\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/buffer-atob-btoa\n</code></pre>" }, { "textRaw": "`clearImmediate(immediateObject)`", "type": "method", "name": "clearImmediate", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "signatures": [ { "params": [] } ], "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": "method", "name": "clearInterval", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [] } ], "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": "method", "name": "clearTimeout", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [] } ], "desc": "<p><a href=\"timers.html#cleartimeouttimeout\"><code>clearTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>" }, { "textRaw": "`queueMicrotask(callback)`", "type": "method", "name": "queueMicrotask", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "signatures": [ { "params": [ { "textRaw": "`callback` {Function} Function to be queued.", "name": "callback", "type": "Function", "desc": "Function to be queued." } ] } ], "desc": "<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": "`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>" }, { "textRaw": "`setImmediate(callback[, ...args])`", "type": "method", "name": "setImmediate", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "signatures": [ { "params": [] } ], "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": "method", "name": "setInterval", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [] } ], "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": "method", "name": "setTimeout", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [] } ], "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": "`structuredClone(value[, options])`", "type": "method", "name": "structuredClone", "meta": { "added": [ "v17.0.0" ], "changes": [] }, "signatures": [ { "params": [] } ], "desc": "<p>The WHATWG <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/structuredClone\"><code>structuredClone</code></a> method.</p>" } ], "miscs": [ { "textRaw": "Global objects", "name": "Global objects", "introduced_in": "v0.10.0", "type": "misc", "stability": 2, "stabilityText": "Stable", "desc": "<p>These objects are available in all modules.</p>\n<p>The following variables may appear to be global but are not. They exist only in\nthe scope of <a href=\"modules.html\">CommonJS modules</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>", "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": "`console`", "name": "`console`", "meta": { "added": [ "v0.1.100" ], "changes": [] }, "desc": "<ul>\n<li>Type: <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>", "type": "misc", "displayName": "`console`" }, { "textRaw": "`crypto`", "name": "`crypto`", "meta": { "added": [ "v17.6.0", "v16.15.0" ], "changes": [ { "version": "v23.0.0", "pr-url": "https://github.com/nodejs/node/pull/52564", "description": "No longer experimental." }, { "version": "v19.0.0", "pr-url": "https://github.com/nodejs/node/pull/42083", "description": "No longer behind `--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": "`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": [ "v17.5.0", "v16.15.0" ], "changes": [ { "version": [ "v21.0.0" ], "pr-url": "https://github.com/nodejs/node/pull/45684", "description": "No longer experimental." }, { "version": "v18.0.0", "pr-url": "https://github.com/nodejs/node/pull/41811", "description": "No longer behind `--experimental-fetch` CLI flag." } ] }, "desc": "<p>A browser-compatible implementation of the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch\"><code>fetch()</code></a> function.</p>\n<pre><code class=\"language-mjs\">const res = await fetch('https://nodejs.org/api/documentation.json');\nif (res.ok) {\n const data = await res.json();\n console.log(data);\n}\n</code></pre>\n<p>The implementation is based upon <a href=\"https://undici.nodejs.org\">undici</a>, an HTTP/1.1 client\nwritten from scratch for Node.js. You can figure out which version of <code>undici</code> is bundled\nin your Node.js process reading the <code>process.versions.undici</code> property.</p>", "modules": [ { "textRaw": "Custom dispatcher", "name": "custom_dispatcher", "desc": "<p>You can use a custom dispatcher to dispatch requests passing it in fetch's options object.\nThe dispatcher must be compatible with <code>undici</code>'s\n<a href=\"https://undici.nodejs.org/#/docs/api/Dispatcher.md\"><code>Dispatcher</code> class</a>.</p>\n<pre><code class=\"language-js\">fetch(url, { dispatcher: new MyAgent() });\n</code></pre>\n<p>It is possible to change the global dispatcher in Node.js by installing <code>undici</code> and using\nthe <code>setGlobalDispatcher()</code> method. Calling this method will affect both <code>undici</code> and\nNode.js.</p>\n<pre><code class=\"language-mjs\">import { setGlobalDispatcher } from 'undici';\nsetGlobalDispatcher(new MyAgent());\n</code></pre>", "type": "module", "displayName": "Custom dispatcher" }, { "textRaw": "Related classes", "name": "related_classes", "desc": "<p>The following globals are available to use with <code>fetch</code>:</p>\n<ul>\n<li><a href=\"#class-formdata\"><code>FormData</code></a></li>\n<li><a href=\"#class-headers\"><code>Headers</code></a></li>\n<li><a href=\"#class-request\"><code>Request</code></a></li>\n<li><a href=\"#class-response\"><code>Response</code></a></li>\n</ul>", "type": "module", "displayName": "Related classes" } ], "type": "misc", "displayName": "`fetch`" }, { "textRaw": "`global`", "name": "`global`", "meta": { "added": [ "v0.1.27" ], "changes": [] }, "stability": 3, "stabilityText": "Legacy. Use [`globalThis`][] instead.", "desc": "<ul>\n<li>Type: <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 has traditionally been the global scope. This\nmeans that <code>var something</code> will define a new global variable, except within\nECMAScript modules. In Node.js, this is different. The top-level scope is not\nthe global scope; <code>var something</code> inside a Node.js module will be local to that\nmodule, regardless of whether it is a <a href=\"modules.html\">CommonJS module</a> or an\n<a href=\"esm.html\">ECMAScript module</a>.</p>", "type": "misc", "displayName": "`global`" }, { "textRaw": "`localStorage`", "name": "`localstorage`", "meta": { "added": [ "v22.4.0" ], "changes": [] }, "stability": 1, "stabilityText": ".2 - Release candidate. Enable this API with [`--experimental-webstorage`][].", "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage\"><code>localStorage</code></a>. Data is stored\nunencrypted in the file specified by the <a href=\"cli.html#--localstorage-filefile\"><code>--localstorage-file</code></a> CLI flag.\nThe maximum amount of data that can be stored is 10 MB.\nAny modification of this data outside of the Web Storage API is not supported.\n<code>localStorage</code> data is not stored per user or per request when used in the context\nof a server, it is shared across all users and requests.</p>", "type": "misc", "displayName": "`localStorage`" }, { "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": "`navigator`", "name": "`navigator`", "meta": { "added": [ "v21.0.0" ], "changes": [] }, "stability": 1, "stabilityText": ".1 - Active development. Disable this API with the [`--no-experimental-global-navigator`][] CLI flag.", "desc": "<p>A partial implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/navigator\"><code>window.navigator</code></a>.</p>", "properties": [ { "textRaw": "`hardwareConcurrency` Type: {number}", "type": "number", "name": "Type", "meta": { "added": [ "v21.0.0" ], "changes": [] }, "desc": "<p>The <code>navigator.hardwareConcurrency</code> read-only property returns the number of\nlogical processors available to the current Node.js instance.</p>\n<pre><code class=\"language-js\">console.log(`This process is running on ${navigator.hardwareConcurrency} logical processors`);\n</code></pre>" }, { "textRaw": "`language` Type: {string}", "type": "string", "name": "Type", "meta": { "added": [ "v21.2.0" ], "changes": [] }, "desc": "<p>The <code>navigator.language</code> read-only property returns a string representing the\npreferred language of the Node.js instance. The language will be determined by\nthe ICU library used by Node.js at runtime based on the\ndefault language of the operating system.</p>\n<p>The value is representing the language version as defined in <a href=\"https://www.rfc-editor.org/rfc/rfc5646.txt\">RFC 5646</a>.</p>\n<p>The fallback value on builds without ICU is <code>'en-US'</code>.</p>\n<pre><code class=\"language-js\">console.log(`The preferred language of the Node.js instance has the tag '${navigator.language}'`);\n</code></pre>" }, { "textRaw": "`languages` Type: {string\\[]}", "type": "string\\[]", "name": "Type", "meta": { "added": [ "v21.2.0" ], "changes": [] }, "desc": "<p>The <code>navigator.languages</code> read-only property returns an array of strings\nrepresenting the preferred languages of the Node.js instance.\nBy default <code>navigator.languages</code> contains only the value of\n<code>navigator.language</code>, which will be determined by the ICU library used by\nNode.js at runtime based on the default language of the operating system.</p>\n<p>The fallback value on builds without ICU is <code>['en-US']</code>.</p>\n<pre><code class=\"language-js\">console.log(`The preferred languages are '${navigator.languages}'`);\n</code></pre>" }, { "textRaw": "`navigator.locks`", "name": "locks", "meta": { "added": [ "v24.5.0" ], "changes": [] }, "stability": 1, "stabilityText": "Experimental", "desc": "<p>The <code>navigator.locks</code> read-only property returns a <a href=\"worker_threads.html#class-lockmanager\"><code>LockManager</code></a> instance that\ncan be used to coordinate access to resources that may be shared across multiple\nthreads within the same process. This global implementation matches the semantics\nof the <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/LockManager\">browser <code>LockManager</code></a> API.</p>\n<pre><code class=\"language-mjs\">// Request an exclusive lock\nawait navigator.locks.request('my_resource', async (lock) => {\n // The lock has been acquired.\n console.log(`Lock acquired: ${lock.name}`);\n // Lock is automatically released when the function returns\n});\n\n// Request a shared lock\nawait navigator.locks.request('shared_resource', { mode: 'shared' }, async (lock) => {\n // Multiple shared locks can be held simultaneously\n console.log(`Shared lock acquired: ${lock.name}`);\n});\n</code></pre>\n<pre><code class=\"language-cjs\">// Request an exclusive lock\nnavigator.locks.request('my_resource', async (lock) => {\n // The lock has been acquired.\n console.log(`Lock acquired: ${lock.name}`);\n // Lock is automatically released when the function returns\n}).then(() => {\n console.log('Lock released');\n});\n\n// Request a shared lock\nnavigator.locks.request('shared_resource', { mode: 'shared' }, async (lock) => {\n // Multiple shared locks can be held simultaneously\n console.log(`Shared lock acquired: ${lock.name}`);\n}).then(() => {\n console.log('Shared lock released');\n});\n</code></pre>\n<p>See <a href=\"worker_threads.html#worker_threadslocks\"><code>worker_threads.locks</code></a> for detailed API documentation.</p>" }, { "textRaw": "`platform` Type: {string}", "type": "string", "name": "Type", "meta": { "added": [ "v21.2.0" ], "changes": [] }, "desc": "<p>The <code>navigator.platform</code> read-only property returns a string identifying the\nplatform on which the Node.js instance is running.</p>\n<pre><code class=\"language-js\">console.log(`This process is running on ${navigator.platform}`);\n</code></pre>" }, { "textRaw": "`userAgent` Type: {string}", "type": "string", "name": "Type", "meta": { "added": [ "v21.1.0" ], "changes": [] }, "desc": "<p>The <code>navigator.userAgent</code> read-only property returns user agent\nconsisting of the runtime name and major version number.</p>\n<pre><code class=\"language-js\">console.log(`The user-agent is ${navigator.userAgent}`); // Prints \"Node.js/21\"\n</code></pre>" } ], "type": "misc", "displayName": "`navigator`" }, { "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": "`process`", "name": "`process`", "meta": { "added": [ "v0.1.7" ], "changes": [] }, "desc": "<ul>\n<li>Type: <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>", "type": "misc", "displayName": "`process`" }, { "textRaw": "`sessionStorage`", "name": "`sessionstorage`", "meta": { "added": [ "v22.4.0" ], "changes": [ { "version": "v25.0.0", "pr-url": "https://github.com/nodejs/node/pull/57666", "description": "This API is no longer behind `--experimental-webstorage` runtime flag." } ] }, "stability": 1, "stabilityText": ".2 - Release candidate. Enable this API with [`--experimental-webstorage`][].", "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/sessionStorage\"><code>sessionStorage</code></a>. Data is stored in\nmemory, with a storage quota of 10 MB. <code>sessionStorage</code> data persists only within\nthe currently running process, and is not shared between workers.</p>", "type": "misc", "displayName": "`sessionStorage`" } ], "classes": [ { "textRaw": "Class: `AbortController`", "type": "class", "name": "AbortController", "meta": { "added": [ "v15.0.0", "v14.17.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=\"globals.html#class-abortcontroller\" class=\"type\"><AbortController></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": [ "v17.2.0", "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", "v14.17.0" ], "changes": [] } } ] }, { "textRaw": "Class: `AbortSignal`", "type": "class", "name": "AbortSignal", "meta": { "added": [ "v15.0.0", "v14.17.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": [ "v17.2.0", "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": [ "v17.3.0", "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>" }, { "textRaw": "Static method: `AbortSignal.any(signals)`", "type": "classMethod", "name": "any", "meta": { "added": [ "v20.3.0", "v18.17.0" ], "changes": [] }, "signatures": [ { "params": [ { "textRaw": "`signals` {AbortSignal\\[]} The `AbortSignal`s of which to compose a new `AbortSignal`.", "name": "signals", "type": "AbortSignal\\[]", "desc": "The `AbortSignal`s of which to compose a new `AbortSignal`." } ] } ], "desc": "<p>Returns a new <code>AbortSignal</code> which will be aborted if any of the provided\nsignals are aborted. Its <a href=\"#abortsignalreason\"><code>abortSignal.reason</code></a> will be set to whichever\none of the <code>signals</code> caused it to be aborted.</p>" } ], "events": [ { "textRaw": "Event: `'abort'`", "type": "event", "name": "abort", "meta": { "added": [ "v15.0.0", "v14.17.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}", "type": "boolean", "name": "Type", "meta": { "added": [ "v15.0.0", "v14.17.0" ], "changes": [] }, "desc": "<p>True after the <code>AbortController</code> has been aborted.</p>" }, { "textRaw": "`onabort` Type: {Function}", "type": "Function", "name": "Type", "meta": { "added": [ "v15.0.0", "v14.17.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": [ "v17.2.0", "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": [ "v17.3.0", "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: `Blob`", "type": "class", "name": "Blob", "meta": { "added": [ "v18.0.0" ], "changes": [] }, "desc": "<p>See <a href=\"buffer.html#class-blob\" class=\"type\"><Blob></a>.</p>" }, { "textRaw": "Class: `BroadcastChannel`", "type": "class", "name": "BroadcastChannel", "meta": { "added": [ "v18.0.0" ], "changes": [] }, "desc": "<p>See <a href=\"worker_threads.html#class-broadcastchannel-extends-eventtarget\" class=\"type\"><BroadcastChannel></a>.</p>" }, { "textRaw": "Class: `Buffer`", "type": "class", "name": "Buffer", "meta": { "added": [ "v0.1.103" ], "changes": [] }, "desc": "<ul>\n<li>Type: <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": "Class: `ByteLengthQueuingStrategy`", "type": "class", "name": "ByteLengthQueuingStrategy", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-bytelengthqueuingstrategy\"><code>ByteLengthQueuingStrategy</code></a>.</p>" }, { "textRaw": "Class: `CloseEvent`", "type": "class", "name": "CloseEvent", "meta": { "added": [ "v23.0.0" ], "changes": [] }, "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent\" class=\"type\"><CloseEvent></a>. Disable this API\nwith the <a href=\"cli.html#--no-experimental-websocket\"><code>--no-experimental-websocket</code></a> CLI flag.</p>" }, { "textRaw": "Class: `CompressionStream`", "type": "class", "name": "CompressionStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": "v24.7.0", "pr-url": "https://github.com/nodejs/node/pull/59464", "description": "format now accepts `brotli` value." }, { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-compressionstream\"><code>CompressionStream</code></a>.</p>" }, { "textRaw": "Class: `CountQueuingStrategy`", "type": "class", "name": "CountQueuingStrategy", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-countqueuingstrategy\"><code>CountQueuingStrategy</code></a>.</p>" }, { "textRaw": "Class: `Crypto`", "type": "class", "name": "Crypto", "meta": { "added": [ "v17.6.0", "v16.15.0" ], "changes": [ { "version": "v23.0.0", "pr-url": "https://github.com/nodejs/node/pull/52564", "description": "No longer experimental." }, { "version": "v19.0.0", "pr-url": "https://github.com/nodejs/node/pull/42083", "description": "No longer behind `--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>" }, { "textRaw": "Class: `CryptoKey`", "type": "class", "name": "CryptoKey", "meta": { "added": [ "v17.6.0", "v16.15.0" ], "changes": [ { "version": "v23.0.0", "pr-url": "https://github.com/nodejs/node/pull/52564", "description": "No longer experimental." }, { "version": "v19.0.0", "pr-url": "https://github.com/nodejs/node/pull/42083", "description": "No longer behind `--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>" }, { "textRaw": "Class: `CustomEvent`", "type": "class", "name": "CustomEvent", "meta": { "added": [ "v18.7.0", "v16.17.0" ], "changes": [ { "version": "v23.0.0", "pr-url": "https://github.com/nodejs/node/pull/52723", "description": "No longer experimental." }, { "version": [ "v22.1.0", "v20.13.0" ], "pr-url": "https://github.com/nodejs/node/pull/52618", "description": "CustomEvent is now stable." }, { "version": "v19.0.0", "pr-url": "https://github.com/nodejs/node/pull/44860", "description": "No longer behind `--experimental-global-customevent` CLI flag." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"events.html#class-customevent\" class=\"type\"><CustomEvent></a>.</p>" }, { "textRaw": "Class: `DecompressionStream`", "type": "class", "name": "DecompressionStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": "v24.7.0", "pr-url": "https://github.com/nodejs/node/pull/59464", "description": "format now accepts `brotli` value." }, { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-decompressionstream\"><code>DecompressionStream</code></a>.</p>" }, { "textRaw": "Class: `DOMException`", "type": "class", "name": "DOMException", "meta": { "added": [ "v17.0.0" ], "changes": [] }, "desc": "<p>The WHATWG <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/DOMException\" class=\"type\"><DOMException></a> class.</p>" }, { "textRaw": "Class: `Event`", "type": "class", "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." } ] }, "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": "Class: `EventSource`", "type": "class", "name": "EventSource", "meta": { "added": [ "v22.3.0", "v20.18.0" ], "changes": [] }, "stability": 1, "stabilityText": "Experimental. Enable this API with the [`--experimental-eventsource`][] CLI flag.", "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/EventSource\" class=\"type\"><EventSource></a>.</p>" }, { "textRaw": "Class: `EventTarget`", "type": "class", "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." } ] }, "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": "Class: `File`", "type": "class", "name": "File", "meta": { "added": [ "v20.0.0" ], "changes": [] }, "desc": "<p>See <a href=\"buffer.html#class-file\" class=\"type\"><File></a>.</p>" }, { "textRaw": "Class: `FormData`", "type": "class", "name": "FormData", "meta": { "added": [ "v17.6.0", "v16.15.0" ], "changes": [ { "version": [ "v21.0.0" ], "pr-url": "https://github.com/nodejs/node/pull/45684", "description": "No longer experimental." }, { "version": "v18.0.0", "pr-url": "https://github.com/nodejs/node/pull/41811", "description": "No longer behind `--experimental-fetch` CLI 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>" }, { "textRaw": "Class: `Headers`", "type": "class", "name": "Headers", "meta": { "added": [ "v17.5.0", "v16.15.0" ], "changes": [ { "version": [ "v21.0.0" ], "pr-url": "https://github.com/nodejs/node/pull/45684", "description": "No longer experimental." }, { "version": "v18.0.0", "pr-url": "https://github.com/nodejs/node/pull/41811", "description": "No longer behind `--experimental-fetch` CLI 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>" }, { "textRaw": "Class: `MessageChannel`", "type": "class", "name": "MessageChannel", "meta": { "added": [ "v15.0.0" ], "changes": [] }, "desc": "<p>The <code>MessageChannel</code> class. See <a href=\"worker_threads.html#class-messagechannel\"><code>MessageChannel</code></a> for more details.</p>" }, { "textRaw": "Class: `MessageEvent`", "type": "class", "name": "MessageEvent", "meta": { "added": [ "v15.0.0" ], "changes": [] }, "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/MessageEvent\" class=\"type\"><MessageEvent></a>.</p>" }, { "textRaw": "Class: `MessagePort`", "type": "class", "name": "MessagePort", "meta": { "added": [ "v15.0.0" ], "changes": [] }, "desc": "<p>The <code>MessagePort</code> class. See <a href=\"worker_threads.html#class-messageport\"><code>MessagePort</code></a> for more details.</p>" }, { "textRaw": "Class: `Navigator`", "type": "class", "name": "Navigator", "meta": { "added": [ "v21.0.0" ], "changes": [] }, "stability": 1, "stabilityText": ".1 - Active development. Disable this API with the [`--no-experimental-global-navigator`][] CLI flag.", "desc": "<p>A partial implementation of the <a href=\"https://html.spec.whatwg.org/multipage/system-state.html#the-navigator-object\">Navigator API</a>.</p>" }, { "textRaw": "Class: `PerformanceEntry`", "type": "class", "name": "PerformanceEntry", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "<p>The <code>PerformanceEntry</code> class. See <a href=\"perf_hooks.html#class-performanceentry\"><code>PerformanceEntry</code></a> for more details.</p>" }, { "textRaw": "Class: `PerformanceMark`", "type": "class", "name": "PerformanceMark", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "<p>The <code>PerformanceMark</code> class. See <a href=\"perf_hooks.html#class-performancemark\"><code>PerformanceMark</code></a> for more details.</p>" }, { "textRaw": "Class: `PerformanceMeasure`", "type": "class", "name": "PerformanceMeasure", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "<p>The <code>PerformanceMeasure</code> class. See <a href=\"perf_hooks.html#class-performancemeasure\"><code>PerformanceMeasure</code></a> for more details.</p>" }, { "textRaw": "Class: `PerformanceObserver`", "type": "class", "name": "PerformanceObserver", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "<p>The <code>PerformanceObserver</code> class. See <a href=\"perf_hooks.html#class-performanceobserver\"><code>PerformanceObserver</code></a> for more details.</p>" }, { "textRaw": "Class: `PerformanceObserverEntryList`", "type": "class", "name": "PerformanceObserverEntryList", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "<p>The <code>PerformanceObserverEntryList</code> class. See\n<a href=\"perf_hooks.html#class-performanceobserverentrylist\"><code>PerformanceObserverEntryList</code></a> for more details.</p>" }, { "textRaw": "Class: `PerformanceResourceTiming`", "type": "class", "name": "PerformanceResourceTiming", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "<p>The <code>PerformanceResourceTiming</code> class. See <a href=\"perf_hooks.html#class-performanceresourcetiming\"><code>PerformanceResourceTiming</code></a> for\nmore details.</p>" }, { "textRaw": "Class: `ReadableByteStreamController`", "type": "class", "name": "ReadableByteStreamController", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablebytestreamcontroller\"><code>ReadableByteStreamController</code></a>.</p>" }, { "textRaw": "Class: `ReadableStream`", "type": "class", "name": "ReadableStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestream\"><code>ReadableStream</code></a>.</p>" }, { "textRaw": "Class: `ReadableStreamBYOBReader`", "type": "class", "name": "ReadableStreamBYOBReader", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreambyobreader\"><code>ReadableStreamBYOBReader</code></a>.</p>" }, { "textRaw": "Class: `ReadableStreamBYOBRequest`", "type": "class", "name": "ReadableStreamBYOBRequest", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreambyobrequest\"><code>ReadableStreamBYOBRequest</code></a>.</p>" }, { "textRaw": "Class: `ReadableStreamDefaultController`", "type": "class", "name": "ReadableStreamDefaultController", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreamdefaultcontroller\"><code>ReadableStreamDefaultController</code></a>.</p>" }, { "textRaw": "Class: `ReadableStreamDefaultReader`", "type": "class", "name": "ReadableStreamDefaultReader", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-readablestreamdefaultreader\"><code>ReadableStreamDefaultReader</code></a>.</p>" }, { "textRaw": "Class: `Request`", "type": "class", "name": "Request", "meta": { "added": [ "v17.5.0", "v16.15.0" ], "changes": [ { "version": [ "v21.0.0" ], "pr-url": "https://github.com/nodejs/node/pull/45684", "description": "No longer experimental." }, { "version": "v18.0.0", "pr-url": "https://github.com/nodejs/node/pull/41811", "description": "No longer behind `--experimental-fetch` CLI 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>" }, { "textRaw": "Class: `Response`", "type": "class", "name": "Response", "meta": { "added": [ "v17.5.0", "v16.15.0" ], "changes": [ { "version": [ "v21.0.0" ], "pr-url": "https://github.com/nodejs/node/pull/45684", "description": "No longer experimental." }, { "version": "v18.0.0", "pr-url": "https://github.com/nodejs/node/pull/41811", "description": "No longer behind `--experimental-fetch` CLI 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>" }, { "textRaw": "Class: `Storage`", "type": "class", "name": "Storage", "meta": { "added": [ "v22.4.0" ], "changes": [] }, "stability": 1, "stabilityText": ".2 - Release candidate. Enable this API with [`--experimental-webstorage`][].", "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Storage\" class=\"type\"><Storage></a>.</p>" }, { "textRaw": "Class: `SubtleCrypto`", "type": "class", "name": "SubtleCrypto", "meta": { "added": [ "v17.6.0", "v16.15.0" ], "changes": [ { "version": "v19.0.0", "pr-url": "https://github.com/nodejs/node/pull/42083", "description": "No longer behind `--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>" }, { "textRaw": "Class: `TextDecoder`", "type": "class", "name": "TextDecoder", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "desc": "<p>The WHATWG <code>TextDecoder</code> class. See the <a href=\"util.html#class-utiltextdecoder\"><code>TextDecoder</code></a> section.</p>" }, { "textRaw": "Class: `TextDecoderStream`", "type": "class", "name": "TextDecoderStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-textdecoderstream\"><code>TextDecoderStream</code></a>.</p>" }, { "textRaw": "Class: `TextEncoder`", "type": "class", "name": "TextEncoder", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "desc": "<p>The WHATWG <code>TextEncoder</code> class. See the <a href=\"util.html#class-utiltextencoder\"><code>TextEncoder</code></a> section.</p>" }, { "textRaw": "Class: `TextEncoderStream`", "type": "class", "name": "TextEncoderStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-textencoderstream\"><code>TextEncoderStream</code></a>.</p>" }, { "textRaw": "Class: `TransformStream`", "type": "class", "name": "TransformStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-transformstream\"><code>TransformStream</code></a>.</p>" }, { "textRaw": "Class: `TransformStreamDefaultController`", "type": "class", "name": "TransformStreamDefaultController", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-transformstreamdefaultcontroller\"><code>TransformStreamDefaultController</code></a>.</p>" }, { "textRaw": "Class: `URL`", "type": "class", "name": "URL", "meta": { "added": [ "v10.0.0" ], "changes": [] }, "desc": "<p>The WHATWG <code>URL</code> class. See the <a href=\"url.html#class-url\"><code>URL</code></a> section.</p>" }, { "textRaw": "Class: `URLPattern`", "type": "class", "name": "URLPattern", "meta": { "added": [ "v24.0.0" ], "changes": [] }, "stability": 1, "stabilityText": "Experimental", "desc": "<p>The WHATWG <code>URLPattern</code> class. See the <a href=\"url.html#class-urlpattern\"><code>URLPattern</code></a> section.</p>" }, { "textRaw": "Class: `URLSearchParams`", "type": "class", "name": "URLSearchParams", "meta": { "added": [ "v10.0.0" ], "changes": [] }, "desc": "<p>The WHATWG <code>URLSearchParams</code> class. See the <a href=\"url.html#class-urlsearchparams\"><code>URLSearchParams</code></a> section.</p>" }, { "textRaw": "Class: `WebAssembly`", "type": "class", "name": "WebAssembly", "meta": { "added": [ "v8.0.0" ], "changes": [] }, "desc": "<ul>\n<li>Type: <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>" }, { "textRaw": "Class: `WebSocket`", "type": "class", "name": "WebSocket", "meta": { "added": [ "v21.0.0", "v20.10.0" ], "changes": [ { "version": "v22.4.0", "pr-url": "https://github.com/nodejs/node/pull/53352", "description": "No longer experimental." }, { "version": "v22.0.0", "pr-url": "https://github.com/nodejs/node/pull/51594", "description": "No longer behind `--experimental-websocket` CLI flag." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/WebSocket\" class=\"type\"><WebSocket></a>. Disable this API\nwith the <a href=\"cli.html#--no-experimental-websocket\"><code>--no-experimental-websocket</code></a> CLI flag.</p>" }, { "textRaw": "Class: `WritableStream`", "type": "class", "name": "WritableStream", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-writablestream\"><code>WritableStream</code></a>.</p>" }, { "textRaw": "Class: `WritableStreamDefaultController`", "type": "class", "name": "WritableStreamDefaultController", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-writablestreamdefaultcontroller\"><code>WritableStreamDefaultController</code></a>.</p>" }, { "textRaw": "Class: `WritableStreamDefaultWriter`", "type": "class", "name": "WritableStreamDefaultWriter", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v23.11.0", "v22.15.0" ], "pr-url": "https://github.com/nodejs/node/pull/57510", "description": "Marking the API stable." } ] }, "desc": "<p>A browser-compatible implementation of <a href=\"webstreams.html#class-writablestreamdefaultwriter\"><code>WritableStreamDefaultWriter</code></a>.</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>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/buffer-atob-btoa\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/buffer-atob-btoa\n</code></pre>" }, { "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>\n<p>An automated migration is available (<a href=\"https://github.com/nodejs/userland-migrations/tree/main/recipes/buffer-atob-btoa\">source</a>):</p>\n<pre><code class=\"language-bash\">npx codemod@latest @nodejs/buffer-atob-btoa\n</code></pre>" }, { "textRaw": "`clearImmediate(immediateObject)`", "type": "method", "name": "clearImmediate", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "signatures": [ { "params": [] } ], "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": "method", "name": "clearInterval", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [] } ], "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": "method", "name": "clearTimeout", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [] } ], "desc": "<p><a href=\"timers.html#cleartimeouttimeout\"><code>clearTimeout</code></a> is described in the <a href=\"timers.html\">timers</a> section.</p>" }, { "textRaw": "`queueMicrotask(callback)`", "type": "method", "name": "queueMicrotask", "meta": { "added": [ "v11.0.0" ], "changes": [] }, "signatures": [ { "params": [ { "textRaw": "`callback` {Function} Function to be queued.", "name": "callback", "type": "Function", "desc": "Function to be queued." } ] } ], "desc": "<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": "`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>" }, { "textRaw": "`setImmediate(callback[, ...args])`", "type": "method", "name": "setImmediate", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "signatures": [ { "params": [] } ], "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": "method", "name": "setInterval", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [] } ], "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": "method", "name": "setTimeout", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [] } ], "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": "`structuredClone(value[, options])`", "type": "method", "name": "structuredClone", "meta": { "added": [ "v17.0.0" ], "changes": [] }, "signatures": [ { "params": [] } ], "desc": "<p>The WHATWG <a href=\"https://developer.mozilla.org/en-US/docs/Web/API/Window/structuredClone\"><code>structuredClone</code></a> method.</p>" } ] } ] }
💾 Save Changes
❌ Cancel