Global objects
Table des matières
- Class: AbortController
 - Class: Blob
 - Class: Buffer
 - Class: ByteLengthQueuingStrategy
 - __dirname
 - __filename
 - atob(data)
 - BroadcastChannel
 - btoa(data)
 - clearImmediate(immediateObject)
 - clearInterval(intervalObject)
 - clearTimeout(timeoutObject)
 - Class: CompressionStream
 - console
 - Class: CountQueuingStrategy
 - Crypto
 - crypto
 - CryptoKey
 - CustomEvent
 - Class: DecompressionStream
 - Event
 - EventTarget
 - exports
 - fetch
 - Class FormData
 - global
 - Class Headers
 - MessageChannel
 - MessageEvent
 - MessagePort
 - module
 - PerformanceEntry
 - PerformanceMark
 - PerformanceMeasure
 - PerformanceObserver
 - PerformanceObserverEntryList
 - PerformanceResourceTiming
 - performance
 - process
 - queueMicrotask(callback)
 - Class: ReadableByteStreamController
 - Class: ReadableStream
 - Class: ReadableStreamBYOBReader
 - Class: ReadableStreamBYOBRequest
 - Class: ReadableStreamDefaultController
 - Class: ReadableStreamDefaultReader
 - require()
 - Response
 - Request
 - setImmediate(callback[, ...args])
 - setInterval(callback, delay[, ...args])
 - setTimeout(callback, delay[, ...args])
 - structuredClone(value[, options])
 - SubtleCrypto
 - DOMException
 - TextDecoder
 - Class: TextDecoderStream
 - TextEncoder
 - Class: TextEncoderStream
 - Class: TransformStream
 - Class: TransformStreamDefaultController
 - URL
 - URLSearchParams
 - WebAssembly
 - Class: WritableStream
 - Class: WritableStreamDefaultController
 - Class: WritableStreamDefaultWriter
 
Ajouté en: v0.10.0
These objects are available in all modules. The following variables may appear to be global but are not. They exist only in the scope of modules, see the module system documentation:
The objects listed here are specific to Node.js. There are built-in objects that are part of the JavaScript language itself, which are also globally accessible.
C AbortController
Historique
| Version | Changements | 
|---|---|
| v15.4.0 | No longer experimental. | 
| v15.0.0, v14.17.0 | Ajouté en: v15.0.0, v14.17.0 | 
A utility class used to signal cancelation in selected Promise-based APIs.
The API is based on the Web API AbortController.
JS
M abortController.abort([reason])
Historique
| Version | Changements | 
|---|---|
| v17.2.0, v16.14.0 | Added the new optional reason argument. | 
| v15.0.0, v14.17.0 | Ajouté en: v15.0.0, v14.17.0 | 
reasonanyAn optional reason, retrievable on theAbortSignal'sreasonproperty.
Triggers the abort signal, causing the abortController.signal to emit
the 'abort' event.
M abortController.signal
Ajouté en: v15.0.0, v14.17.0
- Type: 
AbortSignal 
C AbortSignal
Ajouté en: v15.0.0, v14.17.0
- Extends: 
EventTarget 
The AbortSignal is used to notify observers when the
abortController.abort() method is called.
Static method: AbortSignal.abort([reason])
Historique
| Version | Changements | 
|---|---|
| v17.2.0, v16.14.0 | Added the new optional reason argument. | 
| v15.12.0, v14.17.0 | Ajouté en: v15.12.0, v14.17.0 | 
reason:any- Returns: 
AbortSignal 
Returns a new already aborted AbortSignal.
Static method: AbortSignal.timeout(delay)
Ajouté en: v17.3.0, v16.14.0
delaynumberThe number of milliseconds to wait before triggering the AbortSignal.
Returns a new AbortSignal which will be aborted in delay milliseconds.
E 'abort'
Ajouté en: v15.0.0, v14.17.0
The 'abort' event is emitted when the abortController.abort() method
is called. The callback is invoked with a single object argument with a
single type property set to 'abort':
JS
The AbortController with which the AbortSignal is associated will only
ever trigger the 'abort' event once. We recommended that code check
that the abortSignal.aborted attribute is false before adding an 'abort'
event listener.
Any event listeners attached to the AbortSignal should use the
{ once: true } option (or, if using the EventEmitter APIs to attach a
listener, use the once() method) to ensure that the event listener is
removed as soon as the 'abort' event is handled. Failure to do so may
result in memory leaks.
M abortSignal.aborted
Ajouté en: v15.0.0, v14.17.0
- Type: 
booleanTrue after theAbortControllerhas been aborted. 
M abortSignal.onabort
Ajouté en: v15.0.0, v14.17.0
- Type: 
Function 
An optional callback function that may be set by user code to be notified
when the abortController.abort() function has been called.
M abortSignal.reason
Ajouté en: v17.2.0, v16.14.0
- Type: 
any 
An optional reason specified when the AbortSignal was triggered.
JS
M abortSignal.throwIfAborted()
Ajouté en: v17.3.0, v16.17.0
If abortSignal.aborted is true, throws abortSignal.reason.
C Blob
Ajouté en: v18.0.0
See Blob.
C Buffer
Ajouté en: v0.1.103
Used to handle binary data. See the buffer section.
C ByteLengthQueuingStrategy
Ajouté en: v18.0.0
A browser-compatible implementation of ByteLengthQueuingStrategy.
M __dirname
This variable may appear to be global but is not. See __dirname.
M __filename
This variable may appear to be global but is not. See __filename.
M atob(data)
Ajouté en: v16.0.0
Global alias for buffer.atob().
M BroadcastChannel
Ajouté en: v18.0.0
See BroadcastChannel.
M btoa(data)
Ajouté en: v16.0.0
Global alias for buffer.btoa().
M clearImmediate(immediateObject)
Ajouté en: v0.9.1
clearImmediate is described in the timers section.
M clearInterval(intervalObject)
Ajouté en: v0.0.1
clearInterval is described in the timers section.
M clearTimeout(timeoutObject)
Ajouté en: v0.0.1
clearTimeout is described in the timers section.
C CompressionStream
Ajouté en: v18.0.0
A browser-compatible implementation of CompressionStream.
M console
Ajouté en: v0.1.100
Used to print to stdout and stderr. See the console section.
C CountQueuingStrategy
Ajouté en: v18.0.0
A browser-compatible implementation of CountQueuingStrategy.
M Crypto
Historique
| Version | Changements | 
|---|---|
| v19.0.0 | No longer behind `--experimental-global-webcrypto` CLI flag. | 
| v17.6.0, v16.15.0 | Ajouté en: v17.6.0, v16.15.0 | 
A browser-compatible implementation of Crypto. This global is available
only if the Node.js binary was compiled with including support for the
node:crypto module.
M crypto
Historique
| Version | Changements | 
|---|---|
| v19.0.0 | No longer behind `--experimental-global-webcrypto` CLI flag. | 
| v17.6.0, v16.15.0 | Ajouté en: v17.6.0, v16.15.0 | 
A browser-compatible implementation of the Web Crypto API.
M CryptoKey
Historique
| Version | Changements | 
|---|---|
| v19.0.0 | No longer behind `--experimental-global-webcrypto` CLI flag. | 
| v17.6.0, v16.15.0 | Ajouté en: v17.6.0, v16.15.0 | 
A browser-compatible implementation of CryptoKey. This global is available
only if the Node.js binary was compiled with including support for the
node:crypto module.
M CustomEvent
Historique
| Version | Changements | 
|---|---|
| v19.0.0 | No longer behind `--experimental-global-customevent` CLI flag. | 
| v18.7.0, v16.17.0 | Ajouté en: v18.7.0, v16.17.0 | 
A browser-compatible implementation of the CustomEvent Web API.
C DecompressionStream
Ajouté en: v18.0.0
A browser-compatible implementation of DecompressionStream.
M Event
Historique
| Version | Changements | 
|---|---|
| v15.4.0 | No longer experimental. | 
| v15.0.0 | Ajouté en: v15.0.0 | 
A browser-compatible implementation of the Event class. See
EventTarget and Event API for more details.
M EventTarget
Historique
| Version | Changements | 
|---|---|
| v15.4.0 | No longer experimental. | 
| v15.0.0 | Ajouté en: v15.0.0 | 
A browser-compatible implementation of the EventTarget class. See
EventTarget and Event API for more details.
M exports
This variable may appear to be global but is not. See exports.
M fetch
Historique
| Version | Changements | 
|---|---|
| v18.0.0 | No longer behind `--experimental-global-fetch` CLI flag. | 
| v17.5.0, v16.15.0 | Ajouté en: v17.5.0, v16.15.0 | 
A browser-compatible implementation of the fetch() function.
Class FormData
Historique
| Version | Changements | 
|---|---|
| v18.0.0 | No longer behind `--experimental-global-fetch` CLI flag. | 
| v17.6.0, v16.15.0 | Ajouté en: v17.6.0, v16.15.0 | 
A browser-compatible implementation of FormData.
M global
Ajouté en: v0.1.27
ObjectThe global namespace object.
In browsers, the top-level scope is the global scope. This means that
within the browser var something will define a new global variable. In
Node.js this is different. The top-level scope is not the global scope;
var something inside a Node.js module will be local to that module.
Class Headers
Historique
| Version | Changements | 
|---|---|
| v18.0.0 | No longer behind `--experimental-global-fetch` CLI flag. | 
| v17.5.0, v16.15.0 | Ajouté en: v17.5.0, v16.15.0 | 
A browser-compatible implementation of Headers.
M MessageChannel
Ajouté en: v15.0.0
The MessageChannel class. See MessageChannel for more details.
M MessageEvent
Ajouté en: v15.0.0
The MessageEvent class. See MessageEvent for more details.
M MessagePort
Ajouté en: v15.0.0
The MessagePort class. See MessagePort for more details.
M module
This variable may appear to be global but is not. See module.
M PerformanceEntry
Ajouté en: v19.0.0
The PerformanceEntry class. See PerformanceEntry for more details.
M PerformanceMark
Ajouté en: v19.0.0
The PerformanceMark class. See PerformanceMark for more details.
M PerformanceMeasure
Ajouté en: v19.0.0
The PerformanceMeasure class. See PerformanceMeasure for more details.
M PerformanceObserver
Ajouté en: v19.0.0
The PerformanceObserver class. See PerformanceObserver for more details.
M PerformanceObserverEntryList
Ajouté en: v19.0.0
The PerformanceObserverEntryList class. See
PerformanceObserverEntryList for more details.
M PerformanceResourceTiming
Ajouté en: v19.0.0
The PerformanceResourceTiming class. See PerformanceResourceTiming for
more details.
M performance
Ajouté en: v16.0.0
The perf_hooks.performance object.
M process
Ajouté en: v0.1.7
The process object. See the process object section.
M queueMicrotask(callback)
Ajouté en: v11.0.0
callbackFunctionFunction to be queued.
The queueMicrotask() method queues a microtask to invoke callback. If
callback throws an exception, the process object 'uncaughtException'
event will be emitted.
The microtask queue is managed by V8 and may be used in a similar manner to
the process.nextTick() queue, which is managed by Node.js. The
process.nextTick() queue is always processed before the microtask queue
within each turn of the Node.js event loop.
JS
C ReadableByteStreamController
Ajouté en: v18.0.0
A browser-compatible implementation of ReadableByteStreamController.
C ReadableStream
Ajouté en: v18.0.0
A browser-compatible implementation of ReadableStream.
C ReadableStreamBYOBReader
Ajouté en: v18.0.0
A browser-compatible implementation of ReadableStreamBYOBReader.
C ReadableStreamBYOBRequest
Ajouté en: v18.0.0
A browser-compatible implementation of ReadableStreamBYOBRequest.
C ReadableStreamDefaultController
Ajouté en: v18.0.0
A browser-compatible implementation of ReadableStreamDefaultController.
C ReadableStreamDefaultReader
Ajouté en: v18.0.0
A browser-compatible implementation of ReadableStreamDefaultReader.
M require()
This variable may appear to be global but is not. See require().
M Response
Historique
| Version | Changements | 
|---|---|
| v18.0.0 | No longer behind `--experimental-global-fetch` CLI flag. | 
| v17.5.0, v16.15.0 | Ajouté en: v17.5.0, v16.15.0 | 
A browser-compatible implementation of Response.
M Request
Historique
| Version | Changements | 
|---|---|
| v18.0.0 | No longer behind `--experimental-global-fetch` CLI flag. | 
| v17.5.0, v16.15.0 | Ajouté en: v17.5.0, v16.15.0 | 
A browser-compatible implementation of Request.
M setImmediate(callback[, ...args])
Ajouté en: v0.9.1
setImmediate is described in the timers section.
M setInterval(callback, delay[, ...args])
Ajouté en: v0.0.1
setInterval is described in the timers section.
M setTimeout(callback, delay[, ...args])
Ajouté en: v0.0.1
setTimeout is described in the timers section.
M structuredClone(value[, options])
Ajouté en: v17.0.0
The WHATWG structuredClone method.
M SubtleCrypto
Historique
| Version | Changements | 
|---|---|
| v19.0.0 | No longer behind `--experimental-global-webcrypto` CLI flag. | 
| v17.6.0, v16.15.0 | Ajouté en: v17.6.0, v16.15.0 | 
A browser-compatible implementation of SubtleCrypto. This global is available
only if the Node.js binary was compiled with including support for the
node:crypto module.
M DOMException
Ajouté en: v17.0.0
The WHATWG DOMException class. See DOMException for more details.
M TextDecoder
Ajouté en: v11.0.0
The WHATWG TextDecoder class. See the TextDecoder section.
C TextDecoderStream
Ajouté en: v18.0.0
A browser-compatible implementation of TextDecoderStream.
M TextEncoder
Ajouté en: v11.0.0
The WHATWG TextEncoder class. See the TextEncoder section.
C TextEncoderStream
Ajouté en: v18.0.0
A browser-compatible implementation of TextEncoderStream.
C TransformStream
Ajouté en: v18.0.0
A browser-compatible implementation of TransformStream.
C TransformStreamDefaultController
Ajouté en: v18.0.0
A browser-compatible implementation of TransformStreamDefaultController.
M URL
Ajouté en: v10.0.0
The WHATWG URL class. See the URL section.
M URLSearchParams
Ajouté en: v10.0.0
The WHATWG URLSearchParams class. See the URLSearchParams section.
M WebAssembly
Ajouté en: v8.0.0
The object that acts as the namespace for all W3C WebAssembly related functionality. See the Mozilla Developer Network for usage and compatibility.
C WritableStream
Ajouté en: v18.0.0
A browser-compatible implementation of WritableStream.
C WritableStreamDefaultController
Ajouté en: v18.0.0
A browser-compatible implementation of WritableStreamDefaultController.
C WritableStreamDefaultWriter
Ajouté en: v18.0.0
A browser-compatible implementation of WritableStreamDefaultWriter.