{ "type": "module", "source": "doc/api/globals.md", "introduced_in": "v0.10.0", "stability": 2, "stabilityText": "Stable", "classes": [ { "textRaw": "Class: `AbortController`", "name": "AbortController", "type": "class", "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": "

A utility class used to signal cancelation in selected Promise-based APIs.\nThe API is based on the Web API <AbortController>.

\n

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

", "methods": [ { "textRaw": "`abortController.abort([reason])`", "name": "abort", "type": "method", "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.", "optional": true } ] } ], "desc": "

Triggers the abort signal, causing the abortController.signal to emit\nthe 'abort' event.

" } ], "properties": [ { "textRaw": "Type: {AbortSignal}", "name": "signal", "type": "AbortSignal", "meta": { "added": [ "v15.0.0", "v14.17.0" ], "changes": [] } } ] }, { "textRaw": "Class: `AbortSignal`", "name": "AbortSignal", "type": "class", "meta": { "added": [ "v15.0.0", "v14.17.0" ], "changes": [] }, "desc": "

\n

The AbortSignal is used to notify observers when the\nabortController.abort() method is called.

", "classMethods": [ { "textRaw": "Static method: `AbortSignal.abort([reason])`", "name": "abort", "type": "classMethod", "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": [ { "params": [ { "textRaw": "`reason` {any}", "name": "reason", "type": "any", "optional": true } ], "return": { "textRaw": "Returns: {AbortSignal}", "name": "return", "type": "AbortSignal" } } ], "desc": "

Returns a new already aborted AbortSignal.

" }, { "textRaw": "Static method: `AbortSignal.timeout(delay)`", "name": "timeout", "type": "classMethod", "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": "

Returns a new AbortSignal which will be aborted in delay milliseconds.

" }, { "textRaw": "Static method: `AbortSignal.any(signals)`", "name": "any", "type": "classMethod", "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": "

Returns a new AbortSignal which will be aborted if any of the provided\nsignals are aborted. Its abortSignal.reason will be set to whichever\none of the signals caused it to be aborted.

" } ], "events": [ { "textRaw": "Event: `'abort'`", "name": "abort", "type": "event", "meta": { "added": [ "v15.0.0", "v14.17.0" ], "changes": [] }, "params": [], "desc": "

The 'abort' event is emitted when the abortController.abort() method\nis called. The callback is invoked with a single object argument with a\nsingle type property set to 'abort':

\n

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

\n

The AbortController with which the AbortSignal is associated will only\never trigger the 'abort' event once. We recommended that code check\nthat the abortSignal.aborted attribute is false before adding an 'abort'\nevent listener.

\n

Any event listeners attached to the AbortSignal should use the\n{ once: true } option (or, if using the EventEmitter APIs to attach a\nlistener, use the once() method) to ensure that the event listener is\nremoved as soon as the 'abort' event is handled. Failure to do so may\nresult in memory leaks.

" } ], "properties": [ { "textRaw": "Type: {boolean}", "name": "aborted", "type": "boolean", "meta": { "added": [ "v15.0.0", "v14.17.0" ], "changes": [] }, "desc": "

True after the AbortController has been aborted.

" }, { "textRaw": "Type: {Function}", "name": "onabort", "type": "Function", "meta": { "added": [ "v15.0.0", "v14.17.0" ], "changes": [] }, "desc": "

An optional callback function that may be set by user code to be notified\nwhen the abortController.abort() function has been called.

" }, { "textRaw": "Type: {any}", "name": "reason", "type": "any", "meta": { "added": [ "v17.2.0", "v16.14.0" ], "changes": [] }, "desc": "

An optional reason specified when the AbortSignal was triggered.

\n

const ac = new AbortController();\nac.abort(new Error('boom!'));\nconsole.log(ac.signal.reason);  // Error: boom!\n

" } ], "methods": [ { "textRaw": "`abortSignal.throwIfAborted()`", "name": "throwIfAborted", "type": "method", "meta": { "added": [ "v17.3.0", "v16.17.0" ], "changes": [] }, "signatures": [ { "params": [] } ], "desc": "

If abortSignal.aborted is true, throws abortSignal.reason.

" } ] }, { "textRaw": "Class: `Blob`", "name": "Blob", "type": "class", "meta": { "added": [ "v18.0.0" ], "changes": [] }, "desc": "

See <Blob>.

" }, { "textRaw": "Class: `BroadcastChannel`", "name": "BroadcastChannel", "type": "class", "meta": { "added": [ "v18.0.0" ], "changes": [] }, "desc": "

See <BroadcastChannel>.

" }, { "textRaw": "Class: `Buffer`", "name": "Buffer", "type": "class", "meta": { "added": [ "v0.1.103" ], "changes": [] }, "desc": "

\n

Used to handle binary data. See the buffer section.

" }, { "textRaw": "Class: `ByteLengthQueuingStrategy`", "name": "ByteLengthQueuingStrategy", "type": "class", "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": "

A browser-compatible implementation of ByteLengthQueuingStrategy.

" }, { "textRaw": "Class: `CloseEvent`", "name": "CloseEvent", "type": "class", "meta": { "added": [ "v23.0.0" ], "changes": [] }, "desc": "

A browser-compatible implementation of <CloseEvent>. Disable this API\nwith the --no-experimental-websocket CLI flag.

" }, { "textRaw": "Class: `CompressionStream`", "name": "CompressionStream", "type": "class", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v24.7.0", "v22.20.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": "

A browser-compatible implementation of CompressionStream.

" }, { "textRaw": "Class: `CountQueuingStrategy`", "name": "CountQueuingStrategy", "type": "class", "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": "

A browser-compatible implementation of CountQueuingStrategy.

" }, { "textRaw": "Class: `Crypto`", "name": "Crypto", "type": "class", "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": "

A browser-compatible implementation of <Crypto>. This global is available\nonly if the Node.js binary was compiled with including support for the node:crypto module.

" }, { "textRaw": "Class: `CryptoKey`", "name": "CryptoKey", "type": "class", "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": "

A browser-compatible implementation of <CryptoKey>. This global is available\nonly if the Node.js binary was compiled with including support for the node:crypto module.

" }, { "textRaw": "Class: `CustomEvent`", "name": "CustomEvent", "type": "class", "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": "

A browser-compatible implementation of <CustomEvent>.

" }, { "textRaw": "Class: `DecompressionStream`", "name": "DecompressionStream", "type": "class", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v24.7.0", "v22.20.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": "

A browser-compatible implementation of DecompressionStream.

" }, { "textRaw": "Class: `DOMException`", "name": "DOMException", "type": "class", "meta": { "added": [ "v17.0.0" ], "changes": [] }, "desc": "

The WHATWG <DOMException> class.

" }, { "textRaw": "Class: `Event`", "name": "Event", "type": "class", "meta": { "added": [ "v15.0.0" ], "changes": [ { "version": "v15.4.0", "pr-url": "https://github.com/nodejs/node/pull/35949", "description": "No longer experimental." } ] }, "desc": "

A browser-compatible implementation of the Event class. See\nEventTarget and Event API for more details.

" }, { "textRaw": "Class: `EventSource`", "name": "EventSource", "type": "class", "meta": { "added": [ "v22.3.0", "v20.18.0" ], "changes": [] }, "stability": 1, "stabilityText": "Experimental. Enable this API with the `--experimental-eventsource` CLI flag.", "desc": "

A browser-compatible implementation of <EventSource>.

" }, { "textRaw": "Class: `EventTarget`", "name": "EventTarget", "type": "class", "meta": { "added": [ "v15.0.0" ], "changes": [ { "version": "v15.4.0", "pr-url": "https://github.com/nodejs/node/pull/35949", "description": "No longer experimental." } ] }, "desc": "

A browser-compatible implementation of the EventTarget class. See\nEventTarget and Event API for more details.

" }, { "textRaw": "Class: `File`", "name": "File", "type": "class", "meta": { "added": [ "v20.0.0" ], "changes": [] }, "desc": "

See <File>.

" }, { "textRaw": "Class: `FormData`", "name": "FormData", "type": "class", "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": "

A browser-compatible implementation of <FormData>.

" }, { "textRaw": "Class: `Headers`", "name": "Headers", "type": "class", "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": "

A browser-compatible implementation of <Headers>.

" }, { "textRaw": "Class: `MessageChannel`", "name": "MessageChannel", "type": "class", "meta": { "added": [ "v15.0.0" ], "changes": [] }, "desc": "

The MessageChannel class. See MessageChannel for more details.

" }, { "textRaw": "Class: `MessageEvent`", "name": "MessageEvent", "type": "class", "meta": { "added": [ "v15.0.0" ], "changes": [] }, "desc": "

A browser-compatible implementation of <MessageEvent>.

" }, { "textRaw": "Class: `MessagePort`", "name": "MessagePort", "type": "class", "meta": { "added": [ "v15.0.0" ], "changes": [] }, "desc": "

The MessagePort class. See MessagePort for more details.

" }, { "textRaw": "Class: `Navigator`", "name": "Navigator", "type": "class", "meta": { "added": [ "v21.0.0" ], "changes": [] }, "stability": 1.1, "stabilityText": "Active development. Disable this API with the `--no-experimental-global-navigator` CLI flag.", "desc": "

A partial implementation of the Navigator API.

" }, { "textRaw": "Class: `PerformanceEntry`", "name": "PerformanceEntry", "type": "class", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "

The PerformanceEntry class. See PerformanceEntry for more details.

" }, { "textRaw": "Class: `PerformanceMark`", "name": "PerformanceMark", "type": "class", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "

The PerformanceMark class. See PerformanceMark for more details.

" }, { "textRaw": "Class: `PerformanceMeasure`", "name": "PerformanceMeasure", "type": "class", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "

The PerformanceMeasure class. See PerformanceMeasure for more details.

" }, { "textRaw": "Class: `PerformanceObserver`", "name": "PerformanceObserver", "type": "class", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "

The PerformanceObserver class. See PerformanceObserver for more details.

" }, { "textRaw": "Class: `PerformanceObserverEntryList`", "name": "PerformanceObserverEntryList", "type": "class", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "

The PerformanceObserverEntryList class. See\nPerformanceObserverEntryList for more details.

" }, { "textRaw": "Class: `PerformanceResourceTiming`", "name": "PerformanceResourceTiming", "type": "class", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "

The PerformanceResourceTiming class. See PerformanceResourceTiming for\nmore details.

" }, { "textRaw": "Class: `QuotaExceededError`", "name": "QuotaExceededError", "type": "class", "meta": { "added": [ "v26.0.0" ], "changes": [] }, "desc": "

The WHATWG <QuotaExceededError> class. Extends <DOMException>.

" }, { "textRaw": "Class: `ReadableByteStreamController`", "name": "ReadableByteStreamController", "type": "class", "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": "

A browser-compatible implementation of ReadableByteStreamController.

" }, { "textRaw": "Class: `ReadableStream`", "name": "ReadableStream", "type": "class", "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": "

A browser-compatible implementation of ReadableStream.

" }, { "textRaw": "Class: `ReadableStreamBYOBReader`", "name": "ReadableStreamBYOBReader", "type": "class", "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": "

A browser-compatible implementation of ReadableStreamBYOBReader.

" }, { "textRaw": "Class: `ReadableStreamBYOBRequest`", "name": "ReadableStreamBYOBRequest", "type": "class", "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": "

A browser-compatible implementation of ReadableStreamBYOBRequest.

" }, { "textRaw": "Class: `ReadableStreamDefaultController`", "name": "ReadableStreamDefaultController", "type": "class", "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": "

A browser-compatible implementation of ReadableStreamDefaultController.

" }, { "textRaw": "Class: `ReadableStreamDefaultReader`", "name": "ReadableStreamDefaultReader", "type": "class", "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": "

A browser-compatible implementation of ReadableStreamDefaultReader.

" }, { "textRaw": "Class: `Request`", "name": "Request", "type": "class", "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": "

A browser-compatible implementation of <Request>.

" }, { "textRaw": "Class: `Response`", "name": "Response", "type": "class", "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": "

A browser-compatible implementation of <Response>.

" }, { "textRaw": "Class: `Storage`", "name": "Storage", "type": "class", "meta": { "added": [ "v22.4.0" ], "changes": [] }, "stability": 1.2, "stabilityText": "Release candidate. Disable this API with `--no-experimental-webstorage`.", "desc": "

A browser-compatible implementation of <Storage>.

" }, { "textRaw": "Class: `SubtleCrypto`", "name": "SubtleCrypto", "type": "class", "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": "

A browser-compatible implementation of <SubtleCrypto>. This global is available\nonly if the Node.js binary was compiled with including support for the node:crypto module.

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

The WHATWG TextDecoder class. See the TextDecoder section.

" }, { "textRaw": "Class: `TextDecoderStream`", "name": "TextDecoderStream", "type": "class", "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": "

A browser-compatible implementation of TextDecoderStream.

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

The WHATWG TextEncoder class. See the TextEncoder section.

" }, { "textRaw": "Class: `TextEncoderStream`", "name": "TextEncoderStream", "type": "class", "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": "

A browser-compatible implementation of TextEncoderStream.

" }, { "textRaw": "Class: `TransformStream`", "name": "TransformStream", "type": "class", "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": "

A browser-compatible implementation of TransformStream.

" }, { "textRaw": "Class: `TransformStreamDefaultController`", "name": "TransformStreamDefaultController", "type": "class", "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": "

A browser-compatible implementation of TransformStreamDefaultController.

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

The WHATWG URL class. See the URL section.

" }, { "textRaw": "Class: `URLPattern`", "name": "URLPattern", "type": "class", "meta": { "added": [ "v24.0.0" ], "changes": [] }, "stability": 1, "stabilityText": "Experimental", "desc": "

The WHATWG URLPattern class. See the URLPattern section.

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

The WHATWG URLSearchParams class. See the URLSearchParams section.

" }, { "textRaw": "Class: `WebAssembly`", "name": "WebAssembly", "type": "class", "meta": { "added": [ "v8.0.0" ], "changes": [] }, "desc": "

\n

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

" }, { "textRaw": "Class: `WebSocket`", "name": "WebSocket", "type": "class", "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": "

A browser-compatible implementation of <WebSocket>. Disable this API\nwith the --no-experimental-websocket CLI flag.

" }, { "textRaw": "Class: `WritableStream`", "name": "WritableStream", "type": "class", "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": "

A browser-compatible implementation of WritableStream.

" }, { "textRaw": "Class: `WritableStreamDefaultController`", "name": "WritableStreamDefaultController", "type": "class", "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": "

A browser-compatible implementation of WritableStreamDefaultController.

" }, { "textRaw": "Class: `WritableStreamDefaultWriter`", "name": "WritableStreamDefaultWriter", "type": "class", "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": "

A browser-compatible implementation of WritableStreamDefaultWriter.

" } ], "methods": [ { "textRaw": "`atob(data)`", "name": "atob", "type": "method", "meta": { "added": [ "v16.0.0" ], "changes": [] }, "stability": 3, "stabilityText": "Legacy. Use `Buffer.from(data, 'base64')` instead.", "signatures": [ { "params": [ { "name": "data" } ] } ], "desc": "

Global alias for buffer.atob().

\n

An automated migration is available (source):

\n

npx codemod@latest @nodejs/buffer-atob-btoa\n

" }, { "textRaw": "`btoa(data)`", "name": "btoa", "type": "method", "meta": { "added": [ "v16.0.0" ], "changes": [] }, "stability": 3, "stabilityText": "Legacy. Use `buf.toString('base64')` instead.", "signatures": [ { "params": [ { "name": "data" } ] } ], "desc": "

Global alias for buffer.btoa().

\n

An automated migration is available (source):

\n

npx codemod@latest @nodejs/buffer-atob-btoa\n

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

clearImmediate is described in the timers section.

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

clearInterval is described in the timers section.

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

clearTimeout is described in the timers section.

" }, { "textRaw": "`queueMicrotask(callback)`", "name": "queueMicrotask", "type": "method", "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": "

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

\n

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

\n

// Here, `queueMicrotask()` is used to ensure the 'load' event is always\n// emitted asynchronously, and therefore consistently. Using\n// `process.nextTick()` here would result in the 'load' event always emitting\n// before any other promise jobs.\n\nDataHandler.prototype.load = async function load(key) {\n  const hit = this._cache.get(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

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

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

" }, { "textRaw": "`setImmediate(callback[, ...args])`", "name": "setImmediate", "type": "method", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "signatures": [ { "params": [ { "name": "callback" }, { "name": "...args", "optional": true } ] } ], "desc": "

setImmediate is described in the timers section.

" }, { "textRaw": "`setInterval(callback, delay[, ...args])`", "name": "setInterval", "type": "method", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [ { "name": "callback" }, { "name": "delay" }, { "name": "...args", "optional": true } ] } ], "desc": "

setInterval is described in the timers section.

" }, { "textRaw": "`setTimeout(callback, delay[, ...args])`", "name": "setTimeout", "type": "method", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [ { "name": "callback" }, { "name": "delay" }, { "name": "...args", "optional": true } ] } ], "desc": "

setTimeout is described in the timers section.

" }, { "textRaw": "`structuredClone(value[, options])`", "name": "structuredClone", "type": "method", "meta": { "added": [ "v17.0.0" ], "changes": [] }, "signatures": [ { "params": [ { "name": "value" }, { "name": "options", "optional": true } ] } ], "desc": "

The WHATWG structuredClone method.

" } ], "miscs": [ { "textRaw": "Global objects", "name": "Global objects", "introduced_in": "v0.10.0", "type": "misc", "stability": 2, "stabilityText": "Stable", "desc": "

These objects are available in all modules.

\n

The following variables may appear to be global but are not. They exist only in\nthe scope of CommonJS modules:

\n

\n

The objects listed here are specific to Node.js. There are built-in objects\nthat are part of the JavaScript language itself, which are also globally\naccessible.

", "miscs": [ { "textRaw": "`__dirname`", "name": "`__dirname`", "type": "misc", "desc": "

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

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

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

", "displayName": "`__filename`" }, { "textRaw": "`console`", "name": "`console`", "type": "misc", "meta": { "added": [ "v0.1.100" ], "changes": [] }, "desc": "

\n

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

", "displayName": "`console`" }, { "textRaw": "`crypto`", "name": "`crypto`", "type": "misc", "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": "

A browser-compatible implementation of the Web Crypto API.

", "displayName": "`crypto`" }, { "textRaw": "`ErrorEvent`", "name": "`errorevent`", "type": "misc", "meta": { "added": [ "v25.0.0" ], "changes": [] }, "desc": "

A browser-compatible implementation of <ErrorEvent>.

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

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

", "displayName": "`exports`" }, { "textRaw": "`fetch`", "name": "`fetch`", "type": "misc", "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": "

A browser-compatible implementation of the fetch() function.

\n

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

\n

The implementation is based upon undici, an HTTP/1.1 client\nwritten from scratch for Node.js. You can figure out which version of undici is bundled\nin your Node.js process reading the process.versions.undici property.

", "modules": [ { "textRaw": "Custom dispatcher", "name": "custom_dispatcher", "type": "module", "desc": "

You can use a custom dispatcher to dispatch requests passing it in fetch's options object.\nThe dispatcher must be compatible with undici's\nDispatcher class.

\n

fetch(url, { dispatcher: new MyAgent() });\n

\n

It is possible to change the global dispatcher in Node.js by installing undici and using\nthe setGlobalDispatcher() method. Calling this method will affect both undici and\nNode.js.

\n

import { setGlobalDispatcher } from 'undici';\nsetGlobalDispatcher(new MyAgent());\n

", "displayName": "Custom dispatcher" }, { "textRaw": "Related classes", "name": "related_classes", "type": "module", "desc": "

The following globals are available to use with fetch:

\n

", "displayName": "Related classes" } ], "displayName": "`fetch`" }, { "textRaw": "`global`", "name": "`global`", "type": "misc", "meta": { "added": [ "v0.1.27" ], "changes": [] }, "stability": 3, "stabilityText": "Legacy. Use `globalThis` instead.", "desc": "

\n

In browsers, the top-level scope has traditionally been the global scope. This\nmeans that var something 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; var something inside a Node.js module will be local to that\nmodule, regardless of whether it is a CommonJS module or an\nECMAScript module.

", "displayName": "`global`" }, { "textRaw": "`localStorage`", "name": "`localstorage`", "type": "misc", "meta": { "added": [ "v22.4.0" ], "changes": [ { "version": "v26.0.0", "pr-url": "https://github.com/nodejs/node/pull/60351", "description": "Accessing the `localStorage` global without providing `--localstorage-file` now throws a `DOMException`, for compliance with the Web Storage specification." }, { "version": "v25.0.0", "pr-url": "https://github.com/nodejs/node/pull/57666", "description": "When webstorage is enabled and `--localstorage-file` is not provided, accessing the `localStorage` global now returns an empty object." }, { "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.2, "stabilityText": "Release candidate. Disable this API with `--no-experimental-webstorage`.", "desc": "

A browser-compatible implementation of localStorage. Data is stored\nunencrypted in the file specified by the --localstorage-file 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.\nlocalStorage 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.

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

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

", "displayName": "`module`" }, { "textRaw": "`navigator`", "name": "`navigator`", "type": "misc", "meta": { "added": [ "v21.0.0" ], "changes": [] }, "stability": 1.1, "stabilityText": "Active development. Disable this API with the `--no-experimental-global-navigator` CLI flag.", "desc": "

A partial implementation of window.navigator.

", "properties": [ { "textRaw": "Type: {number}", "name": "hardwareConcurrency", "type": "number", "meta": { "added": [ "v21.0.0" ], "changes": [] }, "desc": "

The navigator.hardwareConcurrency read-only property returns the number of\nlogical processors available to the current Node.js instance.

\n

console.log(`This process is running on ${navigator.hardwareConcurrency} logical processors`);\n

" }, { "textRaw": "Type: {string}", "name": "language", "type": "string", "meta": { "added": [ "v21.2.0" ], "changes": [] }, "desc": "

The navigator.language 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.

\n

The value is representing the language version as defined in RFC 5646.

\n

The fallback value on builds without ICU is 'en-US'.

\n

console.log(`The preferred language of the Node.js instance has the tag '${navigator.language}'`);\n

" }, { "textRaw": "Type: {string[]}", "name": "languages", "type": "string[]", "meta": { "added": [ "v21.2.0" ], "changes": [] }, "desc": "

The navigator.languages read-only property returns an array of strings\nrepresenting the preferred languages of the Node.js instance.\nBy default navigator.languages contains only the value of\nnavigator.language, which will be determined by the ICU library used by\nNode.js at runtime based on the default language of the operating system.

\n

The fallback value on builds without ICU is ['en-US'].

\n

console.log(`The preferred languages are '${navigator.languages}'`);\n

" }, { "textRaw": "`navigator.locks`", "name": "locks", "type": "property", "meta": { "added": [ "v24.5.0" ], "changes": [] }, "stability": 1, "stabilityText": "Experimental", "desc": "

The navigator.locks read-only property returns a LockManager 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 browser LockManager API.

\n

// 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

\n

// 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

\n

See worker_threads.locks for detailed API documentation.

" }, { "textRaw": "Type: {string}", "name": "platform", "type": "string", "meta": { "added": [ "v21.2.0" ], "changes": [] }, "desc": "

The navigator.platform read-only property returns a string identifying the\nplatform on which the Node.js instance is running.

\n

console.log(`This process is running on ${navigator.platform}`);\n

" }, { "textRaw": "Type: {string}", "name": "userAgent", "type": "string", "meta": { "added": [ "v21.1.0" ], "changes": [] }, "desc": "

The navigator.userAgent read-only property returns user agent\nconsisting of the runtime name and major version number.

\n

console.log(`The user-agent is ${navigator.userAgent}`); // Prints \"Node.js/21\"\n

" } ], "displayName": "`navigator`" }, { "textRaw": "`performance`", "name": "`performance`", "type": "misc", "meta": { "added": [ "v16.0.0" ], "changes": [] }, "desc": "

The perf_hooks.performance object.

", "displayName": "`performance`" }, { "textRaw": "`process`", "name": "`process`", "type": "misc", "meta": { "added": [ "v0.1.7" ], "changes": [] }, "desc": "

\n

The process object. See the process object section.

", "displayName": "`process`" }, { "textRaw": "`sessionStorage`", "name": "`sessionstorage`", "type": "misc", "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.2, "stabilityText": "Release candidate. Disable this API with `--no-experimental-webstorage`.", "desc": "

A browser-compatible implementation of sessionStorage. Data is stored in\nmemory, with a storage quota of 10 MB. sessionStorage data persists only within\nthe currently running process, and is not shared between workers.

", "displayName": "`sessionStorage`" } ], "classes": [ { "textRaw": "Class: `AbortController`", "name": "AbortController", "type": "class", "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": "

A utility class used to signal cancelation in selected Promise-based APIs.\nThe API is based on the Web API <AbortController>.

\n

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

", "methods": [ { "textRaw": "`abortController.abort([reason])`", "name": "abort", "type": "method", "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.", "optional": true } ] } ], "desc": "

Triggers the abort signal, causing the abortController.signal to emit\nthe 'abort' event.

" } ], "properties": [ { "textRaw": "Type: {AbortSignal}", "name": "signal", "type": "AbortSignal", "meta": { "added": [ "v15.0.0", "v14.17.0" ], "changes": [] } } ] }, { "textRaw": "Class: `AbortSignal`", "name": "AbortSignal", "type": "class", "meta": { "added": [ "v15.0.0", "v14.17.0" ], "changes": [] }, "desc": "

\n

The AbortSignal is used to notify observers when the\nabortController.abort() method is called.

", "classMethods": [ { "textRaw": "Static method: `AbortSignal.abort([reason])`", "name": "abort", "type": "classMethod", "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": [ { "params": [ { "textRaw": "`reason` {any}", "name": "reason", "type": "any", "optional": true } ], "return": { "textRaw": "Returns: {AbortSignal}", "name": "return", "type": "AbortSignal" } } ], "desc": "

Returns a new already aborted AbortSignal.

" }, { "textRaw": "Static method: `AbortSignal.timeout(delay)`", "name": "timeout", "type": "classMethod", "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": "

Returns a new AbortSignal which will be aborted in delay milliseconds.

" }, { "textRaw": "Static method: `AbortSignal.any(signals)`", "name": "any", "type": "classMethod", "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": "

Returns a new AbortSignal which will be aborted if any of the provided\nsignals are aborted. Its abortSignal.reason will be set to whichever\none of the signals caused it to be aborted.

" } ], "events": [ { "textRaw": "Event: `'abort'`", "name": "abort", "type": "event", "meta": { "added": [ "v15.0.0", "v14.17.0" ], "changes": [] }, "params": [], "desc": "

The 'abort' event is emitted when the abortController.abort() method\nis called. The callback is invoked with a single object argument with a\nsingle type property set to 'abort':

\n

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

\n

The AbortController with which the AbortSignal is associated will only\never trigger the 'abort' event once. We recommended that code check\nthat the abortSignal.aborted attribute is false before adding an 'abort'\nevent listener.

\n

Any event listeners attached to the AbortSignal should use the\n{ once: true } option (or, if using the EventEmitter APIs to attach a\nlistener, use the once() method) to ensure that the event listener is\nremoved as soon as the 'abort' event is handled. Failure to do so may\nresult in memory leaks.

" } ], "properties": [ { "textRaw": "Type: {boolean}", "name": "aborted", "type": "boolean", "meta": { "added": [ "v15.0.0", "v14.17.0" ], "changes": [] }, "desc": "

True after the AbortController has been aborted.

" }, { "textRaw": "Type: {Function}", "name": "onabort", "type": "Function", "meta": { "added": [ "v15.0.0", "v14.17.0" ], "changes": [] }, "desc": "

An optional callback function that may be set by user code to be notified\nwhen the abortController.abort() function has been called.

" }, { "textRaw": "Type: {any}", "name": "reason", "type": "any", "meta": { "added": [ "v17.2.0", "v16.14.0" ], "changes": [] }, "desc": "

An optional reason specified when the AbortSignal was triggered.

\n

const ac = new AbortController();\nac.abort(new Error('boom!'));\nconsole.log(ac.signal.reason);  // Error: boom!\n

" } ], "methods": [ { "textRaw": "`abortSignal.throwIfAborted()`", "name": "throwIfAborted", "type": "method", "meta": { "added": [ "v17.3.0", "v16.17.0" ], "changes": [] }, "signatures": [ { "params": [] } ], "desc": "

If abortSignal.aborted is true, throws abortSignal.reason.

" } ] }, { "textRaw": "Class: `Blob`", "name": "Blob", "type": "class", "meta": { "added": [ "v18.0.0" ], "changes": [] }, "desc": "

See <Blob>.

" }, { "textRaw": "Class: `BroadcastChannel`", "name": "BroadcastChannel", "type": "class", "meta": { "added": [ "v18.0.0" ], "changes": [] }, "desc": "

See <BroadcastChannel>.

" }, { "textRaw": "Class: `Buffer`", "name": "Buffer", "type": "class", "meta": { "added": [ "v0.1.103" ], "changes": [] }, "desc": "

\n

Used to handle binary data. See the buffer section.

" }, { "textRaw": "Class: `ByteLengthQueuingStrategy`", "name": "ByteLengthQueuingStrategy", "type": "class", "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": "

A browser-compatible implementation of ByteLengthQueuingStrategy.

" }, { "textRaw": "Class: `CloseEvent`", "name": "CloseEvent", "type": "class", "meta": { "added": [ "v23.0.0" ], "changes": [] }, "desc": "

A browser-compatible implementation of <CloseEvent>. Disable this API\nwith the --no-experimental-websocket CLI flag.

" }, { "textRaw": "Class: `CompressionStream`", "name": "CompressionStream", "type": "class", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v24.7.0", "v22.20.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": "

A browser-compatible implementation of CompressionStream.

" }, { "textRaw": "Class: `CountQueuingStrategy`", "name": "CountQueuingStrategy", "type": "class", "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": "

A browser-compatible implementation of CountQueuingStrategy.

" }, { "textRaw": "Class: `Crypto`", "name": "Crypto", "type": "class", "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": "

A browser-compatible implementation of <Crypto>. This global is available\nonly if the Node.js binary was compiled with including support for the node:crypto module.

" }, { "textRaw": "Class: `CryptoKey`", "name": "CryptoKey", "type": "class", "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": "

A browser-compatible implementation of <CryptoKey>. This global is available\nonly if the Node.js binary was compiled with including support for the node:crypto module.

" }, { "textRaw": "Class: `CustomEvent`", "name": "CustomEvent", "type": "class", "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": "

A browser-compatible implementation of <CustomEvent>.

" }, { "textRaw": "Class: `DecompressionStream`", "name": "DecompressionStream", "type": "class", "meta": { "added": [ "v18.0.0" ], "changes": [ { "version": [ "v24.7.0", "v22.20.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": "

A browser-compatible implementation of DecompressionStream.

" }, { "textRaw": "Class: `DOMException`", "name": "DOMException", "type": "class", "meta": { "added": [ "v17.0.0" ], "changes": [] }, "desc": "

The WHATWG <DOMException> class.

" }, { "textRaw": "Class: `Event`", "name": "Event", "type": "class", "meta": { "added": [ "v15.0.0" ], "changes": [ { "version": "v15.4.0", "pr-url": "https://github.com/nodejs/node/pull/35949", "description": "No longer experimental." } ] }, "desc": "

A browser-compatible implementation of the Event class. See\nEventTarget and Event API for more details.

" }, { "textRaw": "Class: `EventSource`", "name": "EventSource", "type": "class", "meta": { "added": [ "v22.3.0", "v20.18.0" ], "changes": [] }, "stability": 1, "stabilityText": "Experimental. Enable this API with the `--experimental-eventsource` CLI flag.", "desc": "

A browser-compatible implementation of <EventSource>.

" }, { "textRaw": "Class: `EventTarget`", "name": "EventTarget", "type": "class", "meta": { "added": [ "v15.0.0" ], "changes": [ { "version": "v15.4.0", "pr-url": "https://github.com/nodejs/node/pull/35949", "description": "No longer experimental." } ] }, "desc": "

A browser-compatible implementation of the EventTarget class. See\nEventTarget and Event API for more details.

" }, { "textRaw": "Class: `File`", "name": "File", "type": "class", "meta": { "added": [ "v20.0.0" ], "changes": [] }, "desc": "

See <File>.

" }, { "textRaw": "Class: `FormData`", "name": "FormData", "type": "class", "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": "

A browser-compatible implementation of <FormData>.

" }, { "textRaw": "Class: `Headers`", "name": "Headers", "type": "class", "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": "

A browser-compatible implementation of <Headers>.

" }, { "textRaw": "Class: `MessageChannel`", "name": "MessageChannel", "type": "class", "meta": { "added": [ "v15.0.0" ], "changes": [] }, "desc": "

The MessageChannel class. See MessageChannel for more details.

" }, { "textRaw": "Class: `MessageEvent`", "name": "MessageEvent", "type": "class", "meta": { "added": [ "v15.0.0" ], "changes": [] }, "desc": "

A browser-compatible implementation of <MessageEvent>.

" }, { "textRaw": "Class: `MessagePort`", "name": "MessagePort", "type": "class", "meta": { "added": [ "v15.0.0" ], "changes": [] }, "desc": "

The MessagePort class. See MessagePort for more details.

" }, { "textRaw": "Class: `Navigator`", "name": "Navigator", "type": "class", "meta": { "added": [ "v21.0.0" ], "changes": [] }, "stability": 1.1, "stabilityText": "Active development. Disable this API with the `--no-experimental-global-navigator` CLI flag.", "desc": "

A partial implementation of the Navigator API.

" }, { "textRaw": "Class: `PerformanceEntry`", "name": "PerformanceEntry", "type": "class", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "

The PerformanceEntry class. See PerformanceEntry for more details.

" }, { "textRaw": "Class: `PerformanceMark`", "name": "PerformanceMark", "type": "class", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "

The PerformanceMark class. See PerformanceMark for more details.

" }, { "textRaw": "Class: `PerformanceMeasure`", "name": "PerformanceMeasure", "type": "class", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "

The PerformanceMeasure class. See PerformanceMeasure for more details.

" }, { "textRaw": "Class: `PerformanceObserver`", "name": "PerformanceObserver", "type": "class", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "

The PerformanceObserver class. See PerformanceObserver for more details.

" }, { "textRaw": "Class: `PerformanceObserverEntryList`", "name": "PerformanceObserverEntryList", "type": "class", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "

The PerformanceObserverEntryList class. See\nPerformanceObserverEntryList for more details.

" }, { "textRaw": "Class: `PerformanceResourceTiming`", "name": "PerformanceResourceTiming", "type": "class", "meta": { "added": [ "v19.0.0" ], "changes": [] }, "desc": "

The PerformanceResourceTiming class. See PerformanceResourceTiming for\nmore details.

" }, { "textRaw": "Class: `QuotaExceededError`", "name": "QuotaExceededError", "type": "class", "meta": { "added": [ "v26.0.0" ], "changes": [] }, "desc": "

The WHATWG <QuotaExceededError> class. Extends <DOMException>.

" }, { "textRaw": "Class: `ReadableByteStreamController`", "name": "ReadableByteStreamController", "type": "class", "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": "

A browser-compatible implementation of ReadableByteStreamController.

" }, { "textRaw": "Class: `ReadableStream`", "name": "ReadableStream", "type": "class", "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": "

A browser-compatible implementation of ReadableStream.

" }, { "textRaw": "Class: `ReadableStreamBYOBReader`", "name": "ReadableStreamBYOBReader", "type": "class", "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": "

A browser-compatible implementation of ReadableStreamBYOBReader.

" }, { "textRaw": "Class: `ReadableStreamBYOBRequest`", "name": "ReadableStreamBYOBRequest", "type": "class", "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": "

A browser-compatible implementation of ReadableStreamBYOBRequest.

" }, { "textRaw": "Class: `ReadableStreamDefaultController`", "name": "ReadableStreamDefaultController", "type": "class", "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": "

A browser-compatible implementation of ReadableStreamDefaultController.

" }, { "textRaw": "Class: `ReadableStreamDefaultReader`", "name": "ReadableStreamDefaultReader", "type": "class", "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": "

A browser-compatible implementation of ReadableStreamDefaultReader.

" }, { "textRaw": "Class: `Request`", "name": "Request", "type": "class", "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": "

A browser-compatible implementation of <Request>.

" }, { "textRaw": "Class: `Response`", "name": "Response", "type": "class", "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": "

A browser-compatible implementation of <Response>.

" }, { "textRaw": "Class: `Storage`", "name": "Storage", "type": "class", "meta": { "added": [ "v22.4.0" ], "changes": [] }, "stability": 1.2, "stabilityText": "Release candidate. Disable this API with `--no-experimental-webstorage`.", "desc": "

A browser-compatible implementation of <Storage>.

" }, { "textRaw": "Class: `SubtleCrypto`", "name": "SubtleCrypto", "type": "class", "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": "

A browser-compatible implementation of <SubtleCrypto>. This global is available\nonly if the Node.js binary was compiled with including support for the node:crypto module.

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

The WHATWG TextDecoder class. See the TextDecoder section.

" }, { "textRaw": "Class: `TextDecoderStream`", "name": "TextDecoderStream", "type": "class", "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": "

A browser-compatible implementation of TextDecoderStream.

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

The WHATWG TextEncoder class. See the TextEncoder section.

" }, { "textRaw": "Class: `TextEncoderStream`", "name": "TextEncoderStream", "type": "class", "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": "

A browser-compatible implementation of TextEncoderStream.

" }, { "textRaw": "Class: `TransformStream`", "name": "TransformStream", "type": "class", "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": "

A browser-compatible implementation of TransformStream.

" }, { "textRaw": "Class: `TransformStreamDefaultController`", "name": "TransformStreamDefaultController", "type": "class", "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": "

A browser-compatible implementation of TransformStreamDefaultController.

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

The WHATWG URL class. See the URL section.

" }, { "textRaw": "Class: `URLPattern`", "name": "URLPattern", "type": "class", "meta": { "added": [ "v24.0.0" ], "changes": [] }, "stability": 1, "stabilityText": "Experimental", "desc": "

The WHATWG URLPattern class. See the URLPattern section.

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

The WHATWG URLSearchParams class. See the URLSearchParams section.

" }, { "textRaw": "Class: `WebAssembly`", "name": "WebAssembly", "type": "class", "meta": { "added": [ "v8.0.0" ], "changes": [] }, "desc": "

\n

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

" }, { "textRaw": "Class: `WebSocket`", "name": "WebSocket", "type": "class", "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": "

A browser-compatible implementation of <WebSocket>. Disable this API\nwith the --no-experimental-websocket CLI flag.

" }, { "textRaw": "Class: `WritableStream`", "name": "WritableStream", "type": "class", "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": "

A browser-compatible implementation of WritableStream.

" }, { "textRaw": "Class: `WritableStreamDefaultController`", "name": "WritableStreamDefaultController", "type": "class", "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": "

A browser-compatible implementation of WritableStreamDefaultController.

" }, { "textRaw": "Class: `WritableStreamDefaultWriter`", "name": "WritableStreamDefaultWriter", "type": "class", "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": "

A browser-compatible implementation of WritableStreamDefaultWriter.

" } ], "methods": [ { "textRaw": "`atob(data)`", "name": "atob", "type": "method", "meta": { "added": [ "v16.0.0" ], "changes": [] }, "stability": 3, "stabilityText": "Legacy. Use `Buffer.from(data, 'base64')` instead.", "signatures": [ { "params": [ { "name": "data" } ] } ], "desc": "

Global alias for buffer.atob().

\n

An automated migration is available (source):

\n

npx codemod@latest @nodejs/buffer-atob-btoa\n

" }, { "textRaw": "`btoa(data)`", "name": "btoa", "type": "method", "meta": { "added": [ "v16.0.0" ], "changes": [] }, "stability": 3, "stabilityText": "Legacy. Use `buf.toString('base64')` instead.", "signatures": [ { "params": [ { "name": "data" } ] } ], "desc": "

Global alias for buffer.btoa().

\n

An automated migration is available (source):

\n

npx codemod@latest @nodejs/buffer-atob-btoa\n

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

clearImmediate is described in the timers section.

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

clearInterval is described in the timers section.

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

clearTimeout is described in the timers section.

" }, { "textRaw": "`queueMicrotask(callback)`", "name": "queueMicrotask", "type": "method", "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": "

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

\n

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

\n

// Here, `queueMicrotask()` is used to ensure the 'load' event is always\n// emitted asynchronously, and therefore consistently. Using\n// `process.nextTick()` here would result in the 'load' event always emitting\n// before any other promise jobs.\n\nDataHandler.prototype.load = async function load(key) {\n  const hit = this._cache.get(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

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

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

" }, { "textRaw": "`setImmediate(callback[, ...args])`", "name": "setImmediate", "type": "method", "meta": { "added": [ "v0.9.1" ], "changes": [] }, "signatures": [ { "params": [ { "name": "callback" }, { "name": "...args", "optional": true } ] } ], "desc": "

setImmediate is described in the timers section.

" }, { "textRaw": "`setInterval(callback, delay[, ...args])`", "name": "setInterval", "type": "method", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [ { "name": "callback" }, { "name": "delay" }, { "name": "...args", "optional": true } ] } ], "desc": "

setInterval is described in the timers section.

" }, { "textRaw": "`setTimeout(callback, delay[, ...args])`", "name": "setTimeout", "type": "method", "meta": { "added": [ "v0.0.1" ], "changes": [] }, "signatures": [ { "params": [ { "name": "callback" }, { "name": "delay" }, { "name": "...args", "optional": true } ] } ], "desc": "

setTimeout is described in the timers section.

" }, { "textRaw": "`structuredClone(value[, options])`", "name": "structuredClone", "type": "method", "meta": { "added": [ "v17.0.0" ], "changes": [] }, "signatures": [ { "params": [ { "name": "value" }, { "name": "options", "optional": true } ] } ], "desc": "

The WHATWG structuredClone method.

" } ] } ] }