- Assertion testing
- Asynchronous context tracking
- Async hooks
- Buffer
- C++ addons
- C/C++ addons with Node-API
- C++ embedder API
- Child processes
- Cluster
- Command-line options
- Console
- Corepack
- Crypto
- Debugger
- Deprecated APIs
- Diagnostics Channel
- DNS
- Domain
- Errors
- Events
- File system
- Globals
- HTTP
- HTTP/2
- HTTPS
- Inspector
- Internationalization
- Modules: CommonJS modules
- Modules: ECMAScript modules
- Modules:
node:module
API - Modules: Packages
- Net
- OS
- Path
- Performance hooks
- Permissions
- Process
- Punycode
- Query strings
- Readline
- REPL
- Report
- Stream
- String decoder
- Test runner
- Timers
- TLS/SSL
- Trace events
- TTY
- UDP/datagram
- URL
- Utilities
- V8
- VM
- WASI
- Web Crypto API
- Web Streams API
- Worker threads
- Zlib
Node.js v18.12.1 documentation
- Node.js v18.12.1
- ► Other versions
- ► Options
- About this documentation
- Usage and example
- Assert
- Strict assertion mode
- Legacy assertion mode
- Class: assert.AssertionError
- Class:
assert.CallTracker
assert(value[, message])
assert.deepEqual(actual, expected[, message])
assert.deepStrictEqual(actual, expected[, message])
assert.doesNotMatch(string, regexp[, message])
assert.doesNotReject(asyncFn[, error][, message])
assert.doesNotThrow(fn[, error][, message])
assert.equal(actual, expected[, message])
assert.fail([message])
assert.fail(actual, expected[, message[, operator[, stackStartFn]]])
assert.ifError(value)
assert.match(string, regexp[, message])
assert.notDeepEqual(actual, expected[, message])
assert.notDeepStrictEqual(actual, expected[, message])
assert.notEqual(actual, expected[, message])
assert.notStrictEqual(actual, expected[, message])
assert.ok(value[, message])
assert.rejects(asyncFn[, error][, message])
assert.snapshot(value, name)
assert.strictEqual(actual, expected[, message])
assert.throws(fn[, error][, message])
- Asynchronous context tracking
- Introduction
- Class:
AsyncLocalStorage
- Class:
AsyncResource
new AsyncResource(type[, options])
- Static method:
AsyncResource.bind(fn[, type[, thisArg]])
asyncResource.bind(fn[, thisArg])
asyncResource.runInAsyncScope(fn[, thisArg, ...args])
asyncResource.emitDestroy()
asyncResource.asyncId()
asyncResource.triggerAsyncId()
- Using
AsyncResource
for aWorker
thread pool - Integrating
AsyncResource
withEventEmitter
- Async hooks
- Terminology
- Overview
async_hooks.createHook(callbacks)
- Class:
AsyncHook
- Promise execution tracking
- JavaScript embedder API
- Class:
AsyncLocalStorage
- Buffer
- Buffers and character encodings
- Buffers and TypedArrays
- Buffers and iteration
- Class:
Blob
- Class:
Buffer
- Static method:
Buffer.alloc(size[, fill[, encoding]])
- Static method:
Buffer.allocUnsafe(size)
- Static method:
Buffer.allocUnsafeSlow(size)
- Static method:
Buffer.byteLength(string[, encoding])
- Static method:
Buffer.compare(buf1, buf2)
- Static method:
Buffer.concat(list[, totalLength])
- Static method:
Buffer.from(array)
- Static method:
Buffer.from(arrayBuffer[, byteOffset[, length]])
- Static method:
Buffer.from(buffer)
- Static method:
Buffer.from(object[, offsetOrEncoding[, length]])
- Static method:
Buffer.from(string[, encoding])
- Static method:
Buffer.isBuffer(obj)
- Static method:
Buffer.isEncoding(encoding)
- Class property:
Buffer.poolSize
buf[index]
buf.buffer
buf.byteOffset
buf.compare(target[, targetStart[, targetEnd[, sourceStart[, sourceEnd]]]])
buf.copy(target[, targetStart[, sourceStart[, sourceEnd]]])
buf.entries()
buf.equals(otherBuffer)
buf.fill(value[, offset[, end]][, encoding])
buf.includes(value[, byteOffset][, encoding])
buf.indexOf(value[, byteOffset][, encoding])
buf.keys()
buf.lastIndexOf(value[, byteOffset][, encoding])
buf.length
buf.parent
buf.readBigInt64BE([offset])
buf.readBigInt64LE([offset])
buf.readBigUInt64BE([offset])
buf.readBigUInt64LE([offset])
buf.readDoubleBE([offset])
buf.readDoubleLE([offset])
buf.readFloatBE([offset])
buf.readFloatLE([offset])
buf.readInt8([offset])
buf.readInt16BE([offset])
buf.readInt16LE([offset])
buf.readInt32BE([offset])
buf.readInt32LE([offset])
buf.readIntBE(offset, byteLength)
buf.readIntLE(offset, byteLength)
buf.readUInt8([offset])
buf.readUInt16BE([offset])
buf.readUInt16LE([offset])
buf.readUInt32BE([offset])
buf.readUInt32LE([offset])
buf.readUIntBE(offset, byteLength)
buf.readUIntLE(offset, byteLength)
buf.subarray([start[, end]])
buf.slice([start[, end]])
buf.swap16()
buf.swap32()
buf.swap64()
buf.toJSON()
buf.toString([encoding[, start[, end]]])
buf.values()
buf.write(string[, offset[, length]][, encoding])
buf.writeBigInt64BE(value[, offset])
buf.writeBigInt64LE(value[, offset])
buf.writeBigUInt64BE(value[, offset])
buf.writeBigUInt64LE(value[, offset])
buf.writeDoubleBE(value[, offset])
buf.writeDoubleLE(value[, offset])
buf.writeFloatBE(value[, offset])
buf.writeFloatLE(value[, offset])
buf.writeInt8(value[, offset])
buf.writeInt16BE(value[, offset])
buf.writeInt16LE(value[, offset])
buf.writeInt32BE(value[, offset])
buf.writeInt32LE(value[, offset])
buf.writeIntBE(value, offset, byteLength)
buf.writeIntLE(value, offset, byteLength)
buf.writeUInt8(value[, offset])
buf.writeUInt16BE(value[, offset])
buf.writeUInt16LE(value[, offset])
buf.writeUInt32BE(value[, offset])
buf.writeUInt32LE(value[, offset])
buf.writeUIntBE(value, offset, byteLength)
buf.writeUIntLE(value, offset, byteLength)
new Buffer(array)
new Buffer(arrayBuffer[, byteOffset[, length]])
new Buffer(buffer)
new Buffer(size)
new Buffer(string[, encoding])
- Static method:
node:buffer
module APIsBuffer.from()
,Buffer.alloc()
, andBuffer.allocUnsafe()
- C++ addons
- Node-API
- Implications of ABI stability
- Building
- Usage
- Node-API version matrix
- Environment life cycle APIs
- Basic Node-API data types
- Error handling
- Object lifetime management
- Module registration
- Working with JavaScript values
- Enum types
- Object creation functions
napi_create_array
napi_create_array_with_length
napi_create_arraybuffer
napi_create_buffer
napi_create_buffer_copy
napi_create_date
napi_create_external
napi_create_external_arraybuffer
napi_create_external_buffer
napi_create_object
napi_create_symbol
node_api_symbol_for
napi_create_typedarray
napi_create_dataview
- Functions to convert from C types to Node-API
- Functions to convert from Node-API to C types
napi_get_array_length
napi_get_arraybuffer_info
napi_get_buffer_info
napi_get_prototype
napi_get_typedarray_info
napi_get_dataview_info
napi_get_date_value
napi_get_value_bool
napi_get_value_double
napi_get_value_bigint_int64
napi_get_value_bigint_uint64
napi_get_value_bigint_words
napi_get_value_external
napi_get_value_int32
napi_get_value_int64
napi_get_value_string_latin1
napi_get_value_string_utf8
napi_get_value_string_utf16
napi_get_value_uint32
- Functions to get global instances
- Working with JavaScript values and abstract operations
- Working with JavaScript properties
- Structures
- Functions
napi_get_property_names
napi_get_all_property_names
napi_set_property
napi_get_property
napi_has_property
napi_delete_property
napi_has_own_property
napi_set_named_property
napi_get_named_property
napi_has_named_property
napi_set_element
napi_get_element
napi_has_element
napi_delete_element
napi_define_properties
napi_object_freeze
napi_object_seal
- Working with JavaScript functions
- Object wrap
- Simple asynchronous operations
- Custom asynchronous operations
- Version management
- Memory management
- Promises
- Script execution
- libuv event loop
- Asynchronous thread-safe function calls
- Calling a thread-safe function
- Reference counting of thread-safe functions
- Deciding whether to keep the process running
napi_create_threadsafe_function
napi_get_threadsafe_function_context
napi_call_threadsafe_function
napi_acquire_threadsafe_function
napi_release_threadsafe_function
napi_ref_threadsafe_function
napi_unref_threadsafe_function
- Miscellaneous utilities
- C++ embedder API
- Child process
- Asynchronous process creation
- Synchronous process creation
- Class:
ChildProcess
- Event:
'close'
- Event:
'disconnect'
- Event:
'error'
- Event:
'exit'
- Event:
'message'
- Event:
'spawn'
subprocess.channel
subprocess.connected
subprocess.disconnect()
subprocess.exitCode
subprocess.kill([signal])
subprocess.killed
subprocess.pid
subprocess.ref()
subprocess.send(message[, sendHandle[, options]][, callback])
subprocess.signalCode
subprocess.spawnargs
subprocess.spawnfile
subprocess.stderr
subprocess.stdin
subprocess.stdio
subprocess.stdout
subprocess.unref()
- Event:
maxBuffer
and Unicode- Shell requirements
- Default Windows shell
- Advanced serialization
- Cluster
- How it works
- Class:
Worker
- Event:
'disconnect'
- Event:
'exit'
- Event:
'fork'
- Event:
'listening'
- Event:
'message'
- Event:
'online'
- Event:
'setup'
cluster.disconnect([callback])
cluster.fork([env])
cluster.isMaster
cluster.isPrimary
cluster.isWorker
cluster.schedulingPolicy
cluster.settings
cluster.setupMaster([settings])
cluster.setupPrimary([settings])
cluster.worker
cluster.workers
- Command-line API
- Synopsis
- Program entry point
- Options
-
--
--abort-on-uncaught-exception
--build-snapshot
--completion-bash
-C=condition
,--conditions=condition
--cpu-prof
--cpu-prof-dir
--cpu-prof-interval
--cpu-prof-name
--diagnostic-dir=directory
--disable-proto=mode
--disallow-code-generation-from-strings
--dns-result-order=order
--enable-fips
--enable-source-maps
--experimental-global-customevent
--experimental-global-webcrypto
--experimental-import-meta-resolve
--experimental-loader=module
--experimental-network-imports
--experimental-policy
--no-experimental-fetch
--no-experimental-repl-await
--experimental-specifier-resolution=mode
--experimental-vm-modules
--experimental-wasi-unstable-preview1
--experimental-wasm-modules
--force-context-aware
--force-fips
--frozen-intrinsics
--force-node-api-uncaught-exceptions-policy
--heapsnapshot-near-heap-limit=max_count
--heapsnapshot-signal=signal
--heap-prof
--heap-prof-dir
--heap-prof-interval
--heap-prof-name
--icu-data-dir=file
--input-type=type
--inspect-brk[=[host:]port]
--inspect-port=[host:]port
--inspect[=[host:]port]
--inspect-publish-uid=stderr,http
--insecure-http-parser
--jitless
--max-http-header-size=size
--napi-modules
--no-addons
--no-deprecation
--no-extra-info-on-fatal-exception
--no-force-async-hooks-checks
--no-global-search-paths
--no-warnings
--node-memory-debug
--openssl-config=file
--openssl-shared-config
--openssl-legacy-provider
--pending-deprecation
--policy-integrity=sri
--preserve-symlinks
--preserve-symlinks-main
--prof
--prof-process
--redirect-warnings=file
--report-compact
--report-dir=directory
,report-directory=directory
--report-filename=filename
--report-on-fatalerror
--report-on-signal
--report-signal=signal
--report-uncaught-exception
--secure-heap=n
--secure-heap-min=n
--snapshot-blob=path
--test
--test-name-pattern
--test-only
--throw-deprecation
--title=title
--tls-cipher-list=list
--tls-keylog=file
--tls-max-v1.2
--tls-max-v1.3
--tls-min-v1.0
--tls-min-v1.1
--tls-min-v1.2
--tls-min-v1.3
--trace-atomics-wait
--trace-deprecation
--trace-event-categories
--trace-event-file-pattern
--trace-events-enabled
--trace-exit
--trace-sigint
--trace-sync-io
--trace-tls
--trace-uncaught
--trace-warnings
--track-heap-objects
--unhandled-rejections=mode
--update-assert-snapshot
--use-bundled-ca
,--use-openssl-ca
--use-largepages=mode
--v8-options
--v8-pool-size=num
--watch
--watch-path
--zero-fill-buffers
-c
,--check
-e
,--eval "script"
-h
,--help
-i
,--interactive
-p
,--print "script"
-r
,--require module
-v
,--version
- Environment variables
FORCE_COLOR=[1, 2, 3]
NODE_DEBUG=module[,…]
NODE_DEBUG_NATIVE=module[,…]
NODE_DISABLE_COLORS=1
NODE_EXTRA_CA_CERTS=file
NODE_ICU_DATA=file
NODE_NO_WARNINGS=1
NODE_OPTIONS=options...
NODE_PATH=path[:…]
NODE_PENDING_DEPRECATION=1
NODE_PENDING_PIPE_INSTANCES=instances
NODE_PRESERVE_SYMLINKS=1
NODE_REDIRECT_WARNINGS=file
NODE_REPL_HISTORY=file
NODE_REPL_EXTERNAL_MODULE=file
NODE_SKIP_PLATFORM_CHECK=value
NODE_TLS_REJECT_UNAUTHORIZED=value
NODE_V8_COVERAGE=dir
NO_COLOR=<any>
OPENSSL_CONF=file
SSL_CERT_DIR=dir
SSL_CERT_FILE=file
TZ
UV_THREADPOOL_SIZE=size
- Useful V8 options
- Console
- Class:
Console
new Console(stdout[, stderr][, ignoreErrors])
new Console(options)
console.assert(value[, ...message])
console.clear()
console.count([label])
console.countReset([label])
console.debug(data[, ...args])
console.dir(obj[, options])
console.dirxml(...data)
console.error([data][, ...args])
console.group([...label])
console.groupCollapsed()
console.groupEnd()
console.info([data][, ...args])
console.log([data][, ...args])
console.table(tabularData[, properties])
console.time([label])
console.timeEnd([label])
console.timeLog([label][, ...data])
console.trace([message][, ...args])
console.warn([data][, ...args])
- Inspector only methods
- Class:
- Corepack
- Crypto
- Determining if crypto support is unavailable
- Class:
Certificate
- Class:
Cipher
- Class:
Decipher
- Class:
DiffieHellman
diffieHellman.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding])
diffieHellman.generateKeys([encoding])
diffieHellman.getGenerator([encoding])
diffieHellman.getPrime([encoding])
diffieHellman.getPrivateKey([encoding])
diffieHellman.getPublicKey([encoding])
diffieHellman.setPrivateKey(privateKey[, encoding])
diffieHellman.setPublicKey(publicKey[, encoding])
diffieHellman.verifyError
- Class:
DiffieHellmanGroup
- Class:
ECDH
- Static method:
ECDH.convertKey(key, curve[, inputEncoding[, outputEncoding[, format]]])
ecdh.computeSecret(otherPublicKey[, inputEncoding][, outputEncoding])
ecdh.generateKeys([encoding[, format]])
ecdh.getPrivateKey([encoding])
ecdh.getPublicKey([encoding][, format])
ecdh.setPrivateKey(privateKey[, encoding])
ecdh.setPublicKey(publicKey[, encoding])
- Static method:
- Class:
Hash
- Class:
Hmac
- Class:
KeyObject
- Class:
Sign
- Class:
Verify
- Class:
X509Certificate
new X509Certificate(buffer)
x509.ca
x509.checkEmail(email[, options])
x509.checkHost(name[, options])
x509.checkIP(ip)
x509.checkIssued(otherCert)
x509.checkPrivateKey(privateKey)
x509.fingerprint
x509.fingerprint256
x509.fingerprint512
x509.infoAccess
x509.issuer
x509.issuerCertificate
x509.keyUsage
x509.publicKey
x509.raw
x509.serialNumber
x509.subject
x509.subjectAltName
x509.toJSON()
x509.toLegacyObject()
x509.toString()
x509.validFrom
x509.validTo
x509.verify(publicKey)
node:crypto
module methods and propertiescrypto.constants
crypto.DEFAULT_ENCODING
crypto.fips
crypto.checkPrime(candidate[, options], callback)
crypto.checkPrimeSync(candidate[, options])
crypto.createCipher(algorithm, password[, options])
crypto.createCipheriv(algorithm, key, iv[, options])
crypto.createDecipher(algorithm, password[, options])
crypto.createDecipheriv(algorithm, key, iv[, options])
crypto.createDiffieHellman(prime[, primeEncoding][, generator][, generatorEncoding])
crypto.createDiffieHellman(primeLength[, generator])
crypto.createDiffieHellmanGroup(name)
crypto.createECDH(curveName)
crypto.createHash(algorithm[, options])
crypto.createHmac(algorithm, key[, options])
crypto.createPrivateKey(key)
crypto.createPublicKey(key)
crypto.createSecretKey(key[, encoding])
crypto.createSign(algorithm[, options])
crypto.createVerify(algorithm[, options])
crypto.diffieHellman(options)
crypto.generateKey(type, options, callback)
crypto.generateKeyPair(type, options, callback)
crypto.generateKeyPairSync(type, options)
crypto.generateKeySync(type, options)
crypto.generatePrime(size[, options[, callback]])
crypto.generatePrimeSync(size[, options])
crypto.getCipherInfo(nameOrNid[, options])
crypto.getCiphers()
crypto.getCurves()
crypto.getDiffieHellman(groupName)
crypto.getFips()
crypto.getHashes()
crypto.getRandomValues(typedArray)
crypto.hkdf(digest, ikm, salt, info, keylen, callback)
crypto.hkdfSync(digest, ikm, salt, info, keylen)
crypto.pbkdf2(password, salt, iterations, keylen, digest, callback)
crypto.pbkdf2Sync(password, salt, iterations, keylen, digest)
crypto.privateDecrypt(privateKey, buffer)
crypto.privateEncrypt(privateKey, buffer)
crypto.publicDecrypt(key, buffer)
crypto.publicEncrypt(key, buffer)
crypto.randomBytes(size[, callback])
crypto.randomFillSync(buffer[, offset][, size])
crypto.randomFill(buffer[, offset][, size], callback)
crypto.randomInt([min, ]max[, callback])
crypto.randomUUID([options])
crypto.scrypt(password, salt, keylen[, options], callback)
crypto.scryptSync(password, salt, keylen[, options])
crypto.secureHeapUsed()
crypto.setEngine(engine[, flags])
crypto.setFips(bool)
crypto.sign(algorithm, data, key[, callback])
crypto.subtle
crypto.timingSafeEqual(a, b)
crypto.verify(algorithm, data, key, signature[, callback])
crypto.webcrypto
- Notes
- Crypto constants
- Debugger
- Deprecated APIs
- Revoking deprecations
- List of deprecated APIs
- DEP0001:
http.OutgoingMessage.prototype.flush
- DEP0002:
require('_linklist')
- DEP0003:
_writableState.buffer
- DEP0004:
CryptoStream.prototype.readyState
- DEP0005:
Buffer()
constructor - DEP0006:
child_process
options.customFds
- DEP0007: Replace
cluster
worker.suicide
withworker.exitedAfterDisconnect
- DEP0008:
require('node:constants')
- DEP0009:
crypto.pbkdf2
without digest - DEP0010:
crypto.createCredentials
- DEP0011:
crypto.Credentials
- DEP0012:
Domain.dispose
- DEP0013:
fs
asynchronous function without callback - DEP0014:
fs.read
legacy String interface - DEP0015:
fs.readSync
legacy String interface - DEP0016:
GLOBAL
/root
- DEP0017:
Intl.v8BreakIterator
- DEP0018: Unhandled promise rejections
- DEP0019:
require('.')
resolved outside directory - DEP0020:
Server.connections
- DEP0021:
Server.listenFD
- DEP0022:
os.tmpDir()
- DEP0023:
os.getNetworkInterfaces()
- DEP0024:
REPLServer.prototype.convertToContext()
- DEP0025:
require('node:sys')
- DEP0026:
util.print()
- DEP0027:
util.puts()
- DEP0028:
util.debug()
- DEP0029:
util.error()
- DEP0030:
SlowBuffer
- DEP0031:
ecdh.setPublicKey()
- DEP0032:
node:domain
module - DEP0033:
EventEmitter.listenerCount()
- DEP0034:
fs.exists(path, callback)
- DEP0035:
fs.lchmod(path, mode, callback)
- DEP0036:
fs.lchmodSync(path, mode)
- DEP0037:
fs.lchown(path, uid, gid, callback)
- DEP0038:
fs.lchownSync(path, uid, gid)
- DEP0039:
require.extensions
- DEP0040:
node:punycode
module - DEP0041:
NODE_REPL_HISTORY_FILE
environment variable - DEP0042:
tls.CryptoStream
- DEP0043:
tls.SecurePair
- DEP0044:
util.isArray()
- DEP0045:
util.isBoolean()
- DEP0046:
util.isBuffer()
- DEP0047:
util.isDate()
- DEP0048:
util.isError()
- DEP0049:
util.isFunction()
- DEP0050:
util.isNull()
- DEP0051:
util.isNullOrUndefined()
- DEP0052:
util.isNumber()
- DEP0053:
util.isObject()
- DEP0054:
util.isPrimitive()
- DEP0055:
util.isRegExp()
- DEP0056:
util.isString()
- DEP0057:
util.isSymbol()
- DEP0058:
util.isUndefined()
- DEP0059:
util.log()
- DEP0060:
util._extend()
- DEP0061:
fs.SyncWriteStream
- DEP0062:
node --debug
- DEP0063:
ServerResponse.prototype.writeHeader()
- DEP0064:
tls.createSecurePair()
- DEP0065:
repl.REPL_MODE_MAGIC
andNODE_REPL_MODE=magic
- DEP0066:
OutgoingMessage.prototype._headers, OutgoingMessage.prototype._headerNames
- DEP0067:
OutgoingMessage.prototype._renderHeaders
- DEP0068:
node debug
- DEP0069:
vm.runInDebugContext(string)
- DEP0070:
async_hooks.currentId()
- DEP0071:
async_hooks.triggerId()
- DEP0072:
async_hooks.AsyncResource.triggerId()
- DEP0073: Several internal properties of
net.Server
- DEP0074:
REPLServer.bufferedCommand
- DEP0075:
REPLServer.parseREPLKeyword()
- DEP0076:
tls.parseCertString()
- DEP0077:
Module._debug()
- DEP0078:
REPLServer.turnOffEditorMode()
- DEP0079: Custom inspection function on objects via
.inspect()
- DEP0080:
path._makeLong()
- DEP0081:
fs.truncate()
using a file descriptor - DEP0082:
REPLServer.prototype.memory()
- DEP0083: Disabling ECDH by setting
ecdhCurve
tofalse
- DEP0084: requiring bundled internal dependencies
- DEP0085: AsyncHooks sensitive API
- DEP0086: Remove
runInAsyncIdScope
- DEP0089:
require('node:assert')
- DEP0090: Invalid GCM authentication tag lengths
- DEP0091:
crypto.DEFAULT_ENCODING
- DEP0092: Top-level
this
bound tomodule.exports
- DEP0093:
crypto.fips
is deprecated and replaced - DEP0094: Using
assert.fail()
with more than one argument - DEP0095:
timers.enroll()
- DEP0096:
timers.unenroll()
- DEP0097:
MakeCallback
withdomain
property - DEP0098: AsyncHooks embedder
AsyncResource.emitBefore
andAsyncResource.emitAfter
APIs - DEP0099: Async context-unaware
node::MakeCallback
C++ APIs - DEP0100:
process.assert()
- DEP0101:
--with-lttng
- DEP0102: Using
noAssert
inBuffer#(read|write)
operations - DEP0103:
process.binding('util').is[...]
typechecks - DEP0104:
process.env
string coercion - DEP0105:
decipher.finaltol
- DEP0106:
crypto.createCipher
andcrypto.createDecipher
- DEP0107:
tls.convertNPNProtocols()
- DEP0108:
zlib.bytesRead
- DEP0109:
http
,https
, andtls
support for invalid URLs - DEP0110:
vm.Script
cached data - DEP0111:
process.binding()
- DEP0112:
dgram
private APIs - DEP0113:
Cipher.setAuthTag()
,Decipher.getAuthTag()
- DEP0114:
crypto._toBuf()
- DEP0115:
crypto.prng()
,crypto.pseudoRandomBytes()
,crypto.rng()
- DEP0116: Legacy URL API
- DEP0117: Native crypto handles
- DEP0118:
dns.lookup()
support for a falsy host name - DEP0119:
process.binding('uv').errname()
private API - DEP0120: Windows Performance Counter support
- DEP0121:
net._setSimultaneousAccepts()
- DEP0122:
tls
Server.prototype.setOptions()
- DEP0123: setting the TLS ServerName to an IP address
- DEP0124: using
REPLServer.rli
- DEP0125:
require('node:_stream_wrap')
- DEP0126:
timers.active()
- DEP0127:
timers._unrefActive()
- DEP0128: modules with an invalid
main
entry and anindex.js
file - DEP0129:
ChildProcess._channel
- DEP0130:
Module.createRequireFromPath()
- DEP0131: Legacy HTTP parser
- DEP0132:
worker.terminate()
with callback - DEP0133:
http
connection
- DEP0134:
process._tickCallback
- DEP0135:
WriteStream.open()
andReadStream.open()
are internal - DEP0136:
http
finished
- DEP0137: Closing fs.FileHandle on garbage collection
- DEP0138:
process.mainModule
- DEP0139:
process.umask()
with no arguments - DEP0140: Use
request.destroy()
instead ofrequest.abort()
- DEP0141:
repl.inputStream
andrepl.outputStream
- DEP0142:
repl._builtinLibs
- DEP0143:
Transform._transformState
- DEP0144:
module.parent
- DEP0145:
socket.bufferSize
- DEP0146:
new crypto.Certificate()
- DEP0147:
fs.rmdir(path, { recursive: true })
- DEP0148: Folder mappings in
"exports"
(trailing"/"
) - DEP0149:
http.IncomingMessage#connection
- DEP0150: Changing the value of
process.config
- DEP0151: Main index lookup and extension searching
- DEP0152: Extension PerformanceEntry properties
- DEP0153:
dns.lookup
anddnsPromises.lookup
options type coercion - DEP0154: RSA-PSS generate key pair options
- DEP0155: Trailing slashes in pattern specifier resolutions
- DEP0156:
.aborted
property and'abort'
,'aborted'
event inhttp
- DEP0157: Thenable support in streams
- DEP0158:
buffer.slice(start, end)
- DEP0159:
ERR_INVALID_CALLBACK
- DEP0160:
process.on('multipleResolves', handler)
- DEP0161:
process._getActiveRequests()
andprocess._getActiveHandles()
- DEP0162:
fs.write()
,fs.writeFileSync()
coercion to string - DEP0163:
channel.subscribe(onMessage)
,channel.unsubscribe(onMessage)
- DEP0164:
process.exit(code)
,process.exitCode
coercion to integer - DEP0165:
--trace-atomics-wait
- DEP0166: Double slashes in imports and exports targets
- DEP0167: Weak
DiffieHellmanGroup
instances (modp1
,modp2
,modp5
) - DEP0168: Unhandled exception in Node-API callbacks
- DEP0001:
- Diagnostics Channel
- DNS
- Class:
dns.Resolver
dns.getServers()
dns.lookup(hostname[, options], callback)
dns.lookupService(address, port, callback)
dns.resolve(hostname[, rrtype], callback)
dns.resolve4(hostname[, options], callback)
dns.resolve6(hostname[, options], callback)
dns.resolveAny(hostname, callback)
dns.resolveCname(hostname, callback)
dns.resolveCaa(hostname, callback)
dns.resolveMx(hostname, callback)
dns.resolveNaptr(hostname, callback)
dns.resolveNs(hostname, callback)
dns.resolvePtr(hostname, callback)
dns.resolveSoa(hostname, callback)
dns.resolveSrv(hostname, callback)
dns.resolveTxt(hostname, callback)
dns.reverse(ip, callback)
dns.setDefaultResultOrder(order)
dns.setServers(servers)
- DNS promises API
- Class:
dnsPromises.Resolver
resolver.cancel()
dnsPromises.getServers()
dnsPromises.lookup(hostname[, options])
dnsPromises.lookupService(address, port)
dnsPromises.resolve(hostname[, rrtype])
dnsPromises.resolve4(hostname[, options])
dnsPromises.resolve6(hostname[, options])
dnsPromises.resolveAny(hostname)
dnsPromises.resolveCaa(hostname)
dnsPromises.resolveCname(hostname)
dnsPromises.resolveMx(hostname)
dnsPromises.resolveNaptr(hostname)
dnsPromises.resolveNs(hostname)
dnsPromises.resolvePtr(hostname)
dnsPromises.resolveSoa(hostname)
dnsPromises.resolveSrv(hostname)
dnsPromises.resolveTxt(hostname)
dnsPromises.reverse(ip)
dnsPromises.setDefaultResultOrder(order)
dnsPromises.setServers(servers)
- Class:
- Error codes
- Implementation considerations
- Class:
- Domain
- Errors
- Error propagation and interception
- Class:
Error
- Class:
AssertionError
- Class:
RangeError
- Class:
ReferenceError
- Class:
SyntaxError
- Class:
SystemError
- Class:
TypeError
- Exceptions vs. errors
- OpenSSL errors
- Node.js error codes
ABORT_ERR
ERR_AMBIGUOUS_ARGUMENT
ERR_ARG_NOT_ITERABLE
ERR_ASSERTION
ERR_ASSERT_SNAPSHOT_NOT_SUPPORTED
ERR_ASYNC_CALLBACK
ERR_ASYNC_TYPE
ERR_BROTLI_COMPRESSION_FAILED
ERR_BROTLI_INVALID_PARAM
ERR_BUFFER_CONTEXT_NOT_AVAILABLE
ERR_BUFFER_OUT_OF_BOUNDS
ERR_BUFFER_TOO_LARGE
ERR_CANNOT_WATCH_SIGINT
ERR_CHILD_CLOSED_BEFORE_REPLY
ERR_CHILD_PROCESS_IPC_REQUIRED
ERR_CHILD_PROCESS_STDIO_MAXBUFFER
ERR_CLOSED_MESSAGE_PORT
ERR_CONSOLE_WRITABLE_STREAM
ERR_CONSTRUCT_CALL_INVALID
ERR_CONSTRUCT_CALL_REQUIRED
ERR_CONTEXT_NOT_INITIALIZED
ERR_CRYPTO_CUSTOM_ENGINE_NOT_SUPPORTED
ERR_CRYPTO_ECDH_INVALID_FORMAT
ERR_CRYPTO_ECDH_INVALID_PUBLIC_KEY
ERR_CRYPTO_ENGINE_UNKNOWN
ERR_CRYPTO_FIPS_FORCED
ERR_CRYPTO_FIPS_UNAVAILABLE
ERR_CRYPTO_HASH_FINALIZED
ERR_CRYPTO_HASH_UPDATE_FAILED
ERR_CRYPTO_INCOMPATIBLE_KEY
ERR_CRYPTO_INCOMPATIBLE_KEY_OPTIONS
ERR_CRYPTO_INITIALIZATION_FAILED
ERR_CRYPTO_INVALID_AUTH_TAG
ERR_CRYPTO_INVALID_COUNTER
ERR_CRYPTO_INVALID_CURVE
ERR_CRYPTO_INVALID_DIGEST
ERR_CRYPTO_INVALID_IV
ERR_CRYPTO_INVALID_JWK
ERR_CRYPTO_INVALID_KEY_OBJECT_TYPE
ERR_CRYPTO_INVALID_KEYLEN
ERR_CRYPTO_INVALID_KEYPAIR
ERR_CRYPTO_INVALID_KEYTYPE
ERR_CRYPTO_INVALID_MESSAGELEN
ERR_CRYPTO_INVALID_SCRYPT_PARAMS
ERR_CRYPTO_INVALID_STATE
ERR_CRYPTO_INVALID_TAG_LENGTH
ERR_CRYPTO_JOB_INIT_FAILED
ERR_CRYPTO_JWK_UNSUPPORTED_CURVE
ERR_CRYPTO_JWK_UNSUPPORTED_KEY_TYPE
ERR_CRYPTO_OPERATION_FAILED
ERR_CRYPTO_PBKDF2_ERROR
ERR_CRYPTO_SCRYPT_INVALID_PARAMETER
ERR_CRYPTO_SCRYPT_NOT_SUPPORTED
ERR_CRYPTO_SIGN_KEY_REQUIRED
ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH
ERR_CRYPTO_UNKNOWN_CIPHER
ERR_CRYPTO_UNKNOWN_DH_GROUP
ERR_CRYPTO_UNSUPPORTED_OPERATION
ERR_DEBUGGER_ERROR
ERR_DEBUGGER_STARTUP_ERROR
ERR_DLOPEN_DISABLED
ERR_DLOPEN_FAILED
ERR_DIR_CLOSED
ERR_DIR_CONCURRENT_OPERATION
ERR_DNS_SET_SERVERS_FAILED
ERR_DOMAIN_CALLBACK_NOT_AVAILABLE
ERR_DOMAIN_CANNOT_SET_UNCAUGHT_EXCEPTION_CAPTURE
ERR_DUPLICATE_STARTUP_SNAPSHOT_MAIN_FUNCTION
ERR_ENCODING_INVALID_ENCODED_DATA
ERR_ENCODING_NOT_SUPPORTED
ERR_EVAL_ESM_CANNOT_PRINT
ERR_EVENT_RECURSION
ERR_EXECUTION_ENVIRONMENT_NOT_AVAILABLE
ERR_FALSY_VALUE_REJECTION
ERR_FEATURE_UNAVAILABLE_ON_PLATFORM
ERR_FS_CP_DIR_TO_NON_DIR
ERR_FS_CP_EEXIST
ERR_FS_CP_EINVAL
ERR_HTTP_CONTENT_LENGTH_MISMATCH
ERR_FS_CP_FIFO_PIPE
ERR_FS_CP_NON_DIR_TO_DIR
ERR_FS_CP_SOCKET
ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY
ERR_FS_CP_UNKNOWN
ERR_FS_EISDIR
ERR_FS_FILE_TOO_LARGE
ERR_FS_INVALID_SYMLINK_TYPE
ERR_HTTP_HEADERS_SENT
ERR_HTTP_INVALID_HEADER_VALUE
ERR_HTTP_INVALID_STATUS_CODE
ERR_HTTP_REQUEST_TIMEOUT
ERR_HTTP_SOCKET_ENCODING
ERR_HTTP_TRAILER_INVALID
ERR_HTTP2_ALTSVC_INVALID_ORIGIN
ERR_HTTP2_ALTSVC_LENGTH
ERR_HTTP2_CONNECT_AUTHORITY
ERR_HTTP2_CONNECT_PATH
ERR_HTTP2_CONNECT_SCHEME
ERR_HTTP2_ERROR
ERR_HTTP2_GOAWAY_SESSION
ERR_HTTP2_HEADER_SINGLE_VALUE
ERR_HTTP2_HEADERS_AFTER_RESPOND
ERR_HTTP2_HEADERS_SENT
ERR_HTTP2_INFO_STATUS_NOT_ALLOWED
ERR_HTTP2_INVALID_CONNECTION_HEADERS
ERR_HTTP2_INVALID_HEADER_VALUE
ERR_HTTP2_INVALID_INFO_STATUS
ERR_HTTP2_INVALID_ORIGIN
ERR_HTTP2_INVALID_PACKED_SETTINGS_LENGTH
ERR_HTTP2_INVALID_PSEUDOHEADER
ERR_HTTP2_INVALID_SESSION
ERR_HTTP2_INVALID_SETTING_VALUE
ERR_HTTP2_INVALID_STREAM
ERR_HTTP2_MAX_PENDING_SETTINGS_ACK
ERR_HTTP2_NESTED_PUSH
ERR_HTTP2_NO_MEM
ERR_HTTP2_NO_SOCKET_MANIPULATION
ERR_HTTP2_ORIGIN_LENGTH
ERR_HTTP2_OUT_OF_STREAMS
ERR_HTTP2_PAYLOAD_FORBIDDEN
ERR_HTTP2_PING_CANCEL
ERR_HTTP2_PING_LENGTH
ERR_HTTP2_PSEUDOHEADER_NOT_ALLOWED
ERR_HTTP2_PUSH_DISABLED
ERR_HTTP2_SEND_FILE
ERR_HTTP2_SEND_FILE_NOSEEK
ERR_HTTP2_SESSION_ERROR
ERR_HTTP2_SETTINGS_CANCEL
ERR_HTTP2_SOCKET_BOUND
ERR_HTTP2_SOCKET_UNBOUND
ERR_HTTP2_STATUS_101
ERR_HTTP2_STATUS_INVALID
ERR_HTTP2_STREAM_CANCEL
ERR_HTTP2_STREAM_ERROR
ERR_HTTP2_STREAM_SELF_DEPENDENCY
ERR_HTTP2_TOO_MANY_INVALID_FRAMES
ERR_HTTP2_TRAILERS_ALREADY_SENT
ERR_HTTP2_TRAILERS_NOT_READY
ERR_HTTP2_UNSUPPORTED_PROTOCOL
ERR_ILLEGAL_CONSTRUCTOR
ERR_IMPORT_ASSERTION_TYPE_FAILED
ERR_IMPORT_ASSERTION_TYPE_MISSING
ERR_IMPORT_ASSERTION_TYPE_UNSUPPORTED
ERR_INCOMPATIBLE_OPTION_PAIR
ERR_INPUT_TYPE_NOT_ALLOWED
ERR_INSPECTOR_ALREADY_ACTIVATED
ERR_INSPECTOR_ALREADY_CONNECTED
ERR_INSPECTOR_CLOSED
ERR_INSPECTOR_COMMAND
ERR_INSPECTOR_NOT_ACTIVE
ERR_INSPECTOR_NOT_AVAILABLE
ERR_INSPECTOR_NOT_CONNECTED
ERR_INSPECTOR_NOT_WORKER
ERR_INTERNAL_ASSERTION
ERR_INVALID_ADDRESS_FAMILY
ERR_INVALID_ARG_TYPE
ERR_INVALID_ARG_VALUE
ERR_INVALID_ASYNC_ID
ERR_INVALID_BUFFER_SIZE
ERR_INVALID_CHAR
ERR_INVALID_CURSOR_POS
ERR_INVALID_FD
ERR_INVALID_FD_TYPE
ERR_INVALID_FILE_URL_HOST
ERR_INVALID_FILE_URL_PATH
ERR_INVALID_HANDLE_TYPE
ERR_INVALID_HTTP_TOKEN
ERR_INVALID_IP_ADDRESS
ERR_INVALID_MODULE
ERR_INVALID_MODULE_SPECIFIER
ERR_INVALID_OBJECT_DEFINE_PROPERTY
ERR_INVALID_PACKAGE_CONFIG
ERR_INVALID_PACKAGE_TARGET
ERR_INVALID_PERFORMANCE_MARK
ERR_INVALID_PROTOCOL
ERR_INVALID_REPL_EVAL_CONFIG
ERR_INVALID_REPL_INPUT
ERR_INVALID_RETURN_PROPERTY
ERR_INVALID_RETURN_PROPERTY_VALUE
ERR_INVALID_RETURN_VALUE
ERR_INVALID_STATE
ERR_INVALID_SYNC_FORK_INPUT
ERR_INVALID_THIS
ERR_INVALID_TRANSFER_OBJECT
ERR_INVALID_TUPLE
ERR_INVALID_URI
ERR_INVALID_URL
ERR_INVALID_URL_SCHEME
ERR_IPC_CHANNEL_CLOSED
ERR_IPC_DISCONNECTED
ERR_IPC_ONE_PIPE
ERR_IPC_SYNC_FORK
ERR_LOADER_CHAIN_INCOMPLETE
ERR_MANIFEST_ASSERT_INTEGRITY
ERR_MANIFEST_DEPENDENCY_MISSING
ERR_MANIFEST_INTEGRITY_MISMATCH
ERR_MANIFEST_INVALID_RESOURCE_FIELD
ERR_MANIFEST_INVALID_SPECIFIER
ERR_MANIFEST_PARSE_POLICY
ERR_MANIFEST_TDZ
ERR_MANIFEST_UNKNOWN_ONERROR
ERR_MEMORY_ALLOCATION_FAILED
ERR_MESSAGE_TARGET_CONTEXT_UNAVAILABLE
ERR_METHOD_NOT_IMPLEMENTED
ERR_MISSING_ARGS
ERR_MISSING_OPTION
ERR_MISSING_PASSPHRASE
ERR_MISSING_PLATFORM_FOR_WORKER
ERR_MISSING_TRANSFERABLE_IN_TRANSFER_LIST
ERR_MODULE_NOT_FOUND
ERR_MULTIPLE_CALLBACK
ERR_NAPI_CONS_FUNCTION
ERR_NAPI_INVALID_DATAVIEW_ARGS
ERR_NAPI_INVALID_TYPEDARRAY_ALIGNMENT
ERR_NAPI_INVALID_TYPEDARRAY_LENGTH
ERR_NAPI_TSFN_CALL_JS
ERR_NAPI_TSFN_GET_UNDEFINED
ERR_NAPI_TSFN_START_IDLE_LOOP
ERR_NAPI_TSFN_STOP_IDLE_LOOP
ERR_NOT_BUILDING_SNAPSHOT
ERR_NO_CRYPTO
ERR_NO_ICU
ERR_NON_CONTEXT_AWARE_DISABLED
ERR_OUT_OF_RANGE
ERR_PACKAGE_IMPORT_NOT_DEFINED
ERR_PACKAGE_PATH_NOT_EXPORTED
ERR_PARSE_ARGS_INVALID_OPTION_VALUE
ERR_PARSE_ARGS_UNEXPECTED_POSITIONAL
ERR_PARSE_ARGS_UNKNOWN_OPTION
ERR_PERFORMANCE_INVALID_TIMESTAMP
ERR_PERFORMANCE_MEASURE_INVALID_OPTIONS
ERR_PROTO_ACCESS
ERR_REQUIRE_ESM
ERR_SCRIPT_EXECUTION_INTERRUPTED
ERR_SCRIPT_EXECUTION_TIMEOUT
ERR_SERVER_ALREADY_LISTEN
ERR_SERVER_NOT_RUNNING
ERR_SOCKET_ALREADY_BOUND
ERR_SOCKET_BAD_BUFFER_SIZE
ERR_SOCKET_BAD_PORT
ERR_SOCKET_BAD_TYPE
ERR_SOCKET_BUFFER_SIZE
ERR_SOCKET_CLOSED
ERR_SOCKET_DGRAM_IS_CONNECTED
ERR_SOCKET_DGRAM_NOT_CONNECTED
ERR_SOCKET_DGRAM_NOT_RUNNING
ERR_SRI_PARSE
ERR_STREAM_ALREADY_FINISHED
ERR_STREAM_CANNOT_PIPE
ERR_STREAM_DESTROYED
ERR_STREAM_NULL_VALUES
ERR_STREAM_PREMATURE_CLOSE
ERR_STREAM_PUSH_AFTER_EOF
ERR_STREAM_UNSHIFT_AFTER_END_EVENT
ERR_STREAM_WRAP
ERR_STREAM_WRITE_AFTER_END
ERR_STRING_TOO_LONG
ERR_SYNTHETIC
ERR_SYSTEM_ERROR
ERR_TEST_FAILURE
ERR_TLS_CERT_ALTNAME_FORMAT
ERR_TLS_CERT_ALTNAME_INVALID
ERR_TLS_DH_PARAM_SIZE
ERR_TLS_HANDSHAKE_TIMEOUT
ERR_TLS_INVALID_CONTEXT
ERR_TLS_INVALID_PROTOCOL_METHOD
ERR_TLS_INVALID_PROTOCOL_VERSION
ERR_TLS_INVALID_STATE
ERR_TLS_PROTOCOL_VERSION_CONFLICT
ERR_TLS_PSK_SET_IDENTIY_HINT_FAILED
ERR_TLS_RENEGOTIATION_DISABLED
ERR_TLS_REQUIRED_SERVER_NAME
ERR_TLS_SESSION_ATTACK
ERR_TLS_SNI_FROM_SERVER
ERR_TRACE_EVENTS_CATEGORY_REQUIRED
ERR_TRACE_EVENTS_UNAVAILABLE
ERR_TRANSFORM_ALREADY_TRANSFORMING
ERR_TRANSFORM_WITH_LENGTH_0
ERR_TTY_INIT_FAILED
ERR_UNAVAILABLE_DURING_EXIT
ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET
ERR_UNESCAPED_CHARACTERS
ERR_UNHANDLED_ERROR
ERR_UNKNOWN_BUILTIN_MODULE
ERR_UNKNOWN_CREDENTIAL
ERR_UNKNOWN_ENCODING
ERR_UNKNOWN_FILE_EXTENSION
ERR_UNKNOWN_MODULE_FORMAT
ERR_UNKNOWN_SIGNAL
ERR_UNSUPPORTED_DIR_IMPORT
ERR_UNSUPPORTED_ESM_URL_SCHEME
ERR_USE_AFTER_CLOSE
ERR_VALID_PERFORMANCE_ENTRY_TYPE
ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING
ERR_VM_MODULE_ALREADY_LINKED
ERR_VM_MODULE_CACHED_DATA_REJECTED
ERR_VM_MODULE_CANNOT_CREATE_CACHED_DATA
ERR_VM_MODULE_DIFFERENT_CONTEXT
ERR_VM_MODULE_LINK_FAILURE
ERR_VM_MODULE_NOT_MODULE
ERR_VM_MODULE_STATUS
ERR_WASI_ALREADY_STARTED
ERR_WASI_NOT_STARTED
ERR_WEBASSEMBLY_RESPONSE
ERR_WORKER_INIT_FAILED
ERR_WORKER_INVALID_EXEC_ARGV
ERR_WORKER_NOT_RUNNING
ERR_WORKER_OUT_OF_MEMORY
ERR_WORKER_PATH
ERR_WORKER_UNSERIALIZABLE_ERROR
ERR_WORKER_UNSUPPORTED_OPERATION
ERR_ZLIB_INITIALIZATION_FAILED
HPE_HEADER_OVERFLOW
HPE_UNEXPECTED_CONTENT_LENGTH
MODULE_NOT_FOUND
- Legacy Node.js error codes
ERR_CANNOT_TRANSFER_OBJECT
ERR_CRYPTO_HASH_DIGEST_NO_UTF16
ERR_HTTP2_FRAME_ERROR
ERR_HTTP2_HEADERS_OBJECT
ERR_HTTP2_HEADER_REQUIRED
ERR_HTTP2_INFO_HEADERS_AFTER_RESPOND
ERR_HTTP2_STREAM_CLOSED
ERR_HTTP_INVALID_CHAR
ERR_INDEX_OUT_OF_RANGE
ERR_INVALID_OPT_VALUE
ERR_INVALID_OPT_VALUE_ENCODING
ERR_MISSING_MESSAGE_PORT_IN_TRANSFER_LIST
ERR_NAPI_CONS_PROTOTYPE_OBJECT
ERR_NETWORK_IMPORT_BAD_RESPONSE
ERR_NETWORK_IMPORT_DISALLOWED
ERR_NO_LONGER_SUPPORTED
ERR_OPERATION_FAILED
ERR_OUTOFMEMORY
ERR_PARSE_HISTORY_DATA
ERR_SOCKET_CANNOT_SEND
ERR_STDERR_CLOSE
ERR_STDOUT_CLOSE
ERR_STREAM_READ_NOT_IMPLEMENTED
ERR_TLS_RENEGOTIATION_FAILED
ERR_TRANSFERRING_EXTERNALIZED_SHAREDARRAYBUFFER
ERR_UNKNOWN_STDIN_TYPE
ERR_UNKNOWN_STREAM_TYPE
ERR_V8BREAKITERATOR
ERR_VALUE_OUT_OF_RANGE
ERR_VM_MODULE_NOT_LINKED
ERR_VM_MODULE_LINKING_ERRORED
ERR_WORKER_UNSUPPORTED_EXTENSION
ERR_ZLIB_BINDING_CLOSED
ERR_CPU_USAGE
- Events
- Passing arguments and
this
to listeners - Asynchronous vs. synchronous
- Handling events only once
- Error events
- Capture rejections of promises
- Class:
EventEmitter
- Event:
'newListener'
- Event:
'removeListener'
emitter.addListener(eventName, listener)
emitter.emit(eventName[, ...args])
emitter.eventNames()
emitter.getMaxListeners()
emitter.listenerCount(eventName)
emitter.listeners(eventName)
emitter.off(eventName, listener)
emitter.on(eventName, listener)
emitter.once(eventName, listener)
emitter.prependListener(eventName, listener)
emitter.prependOnceListener(eventName, listener)
emitter.removeAllListeners([eventName])
emitter.removeListener(eventName, listener)
emitter.setMaxListeners(n)
emitter.rawListeners(eventName)
emitter[Symbol.for('nodejs.rejection')](err, eventName[, ...args])
- Event:
events.defaultMaxListeners
events.errorMonitor
events.getEventListeners(emitterOrTarget, eventName)
events.once(emitter, name[, options])
events.captureRejections
events.captureRejectionSymbol
events.listenerCount(emitter, eventName)
events.on(emitter, eventName[, options])
events.setMaxListeners(n[, ...eventTargets])
- Class:
events.EventEmitterAsyncResource extends EventEmitter
EventTarget
andEvent
API- Node.js
EventTarget
vs. DOMEventTarget
NodeEventTarget
vs.EventEmitter
- Event listener
EventTarget
error handling- Class:
Event
event.bubbles
event.cancelBubble()
event.cancelable
event.composed
event.composedPath()
event.currentTarget
event.defaultPrevented
event.eventPhase
event.isTrusted
event.preventDefault()
event.returnValue
event.srcElement
event.stopImmediatePropagation()
event.stopPropagation()
event.target
event.timeStamp
event.type
- Class:
EventTarget
- Class:
CustomEvent
- Class:
NodeEventTarget
nodeEventTarget.addListener(type, listener[, options])
nodeEventTarget.eventNames()
nodeEventTarget.listenerCount(type)
nodeEventTarget.off(type, listener)
nodeEventTarget.on(type, listener[, options])
nodeEventTarget.once(type, listener[, options])
nodeEventTarget.removeAllListeners([type])
nodeEventTarget.removeListener(type, listener)
- Node.js
- Passing arguments and
- File system
- Promise example
- Callback example
- Synchronous example
- Promises API
- Class:
FileHandle
- Event:
'close'
filehandle.appendFile(data[, options])
filehandle.chmod(mode)
filehandle.chown(uid, gid)
filehandle.close()
filehandle.createReadStream([options])
filehandle.createWriteStream([options])
filehandle.datasync()
filehandle.fd
filehandle.read(buffer, offset, length, position)
filehandle.read([options])
filehandle.read(buffer[, options])
filehandle.readableWebStream()
filehandle.readFile(options)
filehandle.readLines([options])
filehandle.readv(buffers[, position])
filehandle.stat([options])
filehandle.sync()
filehandle.truncate(len)
filehandle.utimes(atime, mtime)
filehandle.write(buffer, offset[, length[, position]])
filehandle.write(buffer[, options])
filehandle.write(string[, position[, encoding]])
filehandle.writeFile(data, options)
filehandle.writev(buffers[, position])
- Event:
fsPromises.access(path[, mode])
fsPromises.appendFile(path, data[, options])
fsPromises.chmod(path, mode)
fsPromises.chown(path, uid, gid)
fsPromises.copyFile(src, dest[, mode])
fsPromises.cp(src, dest[, options])
fsPromises.lchmod(path, mode)
fsPromises.lchown(path, uid, gid)
fsPromises.lutimes(path, atime, mtime)
fsPromises.link(existingPath, newPath)
fsPromises.lstat(path[, options])
fsPromises.mkdir(path[, options])
fsPromises.mkdtemp(prefix[, options])
fsPromises.open(path, flags[, mode])
fsPromises.opendir(path[, options])
fsPromises.readdir(path[, options])
fsPromises.readFile(path[, options])
fsPromises.readlink(path[, options])
fsPromises.realpath(path[, options])
fsPromises.rename(oldPath, newPath)
fsPromises.rmdir(path[, options])
fsPromises.rm(path[, options])
fsPromises.stat(path[, options])
fsPromises.symlink(target, path[, type])
fsPromises.truncate(path[, len])
fsPromises.unlink(path)
fsPromises.utimes(path, atime, mtime)
fsPromises.watch(filename[, options])
fsPromises.writeFile(file, data[, options])
fsPromises.constants
- Class:
- Callback API
fs.access(path[, mode], callback)
fs.appendFile(path, data[, options], callback)
fs.chmod(path, mode, callback)
fs.chown(path, uid, gid, callback)
fs.close(fd[, callback])
fs.copyFile(src, dest[, mode], callback)
fs.cp(src, dest[, options], callback)
fs.createReadStream(path[, options])
fs.createWriteStream(path[, options])
fs.exists(path, callback)
fs.fchmod(fd, mode, callback)
fs.fchown(fd, uid, gid, callback)
fs.fdatasync(fd, callback)
fs.fstat(fd[, options], callback)
fs.fsync(fd, callback)
fs.ftruncate(fd[, len], callback)
fs.futimes(fd, atime, mtime, callback)
fs.lchmod(path, mode, callback)
fs.lchown(path, uid, gid, callback)
fs.lutimes(path, atime, mtime, callback)
fs.link(existingPath, newPath, callback)
fs.lstat(path[, options], callback)
fs.mkdir(path[, options], callback)
fs.mkdtemp(prefix[, options], callback)
fs.open(path[, flags[, mode]], callback)
fs.opendir(path[, options], callback)
fs.read(fd, buffer, offset, length, position, callback)
fs.read(fd[, options], callback)
fs.read(fd, buffer[, options], callback)
fs.readdir(path[, options], callback)
fs.readFile(path[, options], callback)
fs.readlink(path[, options], callback)
fs.readv(fd, buffers[, position], callback)
fs.realpath(path[, options], callback)
fs.realpath.native(path[, options], callback)
fs.rename(oldPath, newPath, callback)
fs.rmdir(path[, options], callback)
fs.rm(path[, options], callback)
fs.stat(path[, options], callback)
fs.symlink(target, path[, type], callback)
fs.truncate(path[, len], callback)
fs.unlink(path, callback)
fs.unwatchFile(filename[, listener])
fs.utimes(path, atime, mtime, callback)
fs.watch(filename[, options][, listener])
fs.watchFile(filename[, options], listener)
fs.write(fd, buffer, offset[, length[, position]], callback)
fs.write(fd, buffer[, options], callback)
fs.write(fd, string[, position[, encoding]], callback)
fs.writeFile(file, data[, options], callback)
fs.writev(fd, buffers[, position], callback)
- Synchronous API
fs.accessSync(path[, mode])
fs.appendFileSync(path, data[, options])
fs.chmodSync(path, mode)
fs.chownSync(path, uid, gid)
fs.closeSync(fd)
fs.copyFileSync(src, dest[, mode])
fs.cpSync(src, dest[, options])
fs.existsSync(path)
fs.fchmodSync(fd, mode)
fs.fchownSync(fd, uid, gid)
fs.fdatasyncSync(fd)
fs.fstatSync(fd[, options])
fs.fsyncSync(fd)
fs.ftruncateSync(fd[, len])
fs.futimesSync(fd, atime, mtime)
fs.lchmodSync(path, mode)
fs.lchownSync(path, uid, gid)
fs.lutimesSync(path, atime, mtime)
fs.linkSync(existingPath, newPath)
fs.lstatSync(path[, options])
fs.mkdirSync(path[, options])
fs.mkdtempSync(prefix[, options])
fs.opendirSync(path[, options])
fs.openSync(path[, flags[, mode]])
fs.readdirSync(path[, options])
fs.readFileSync(path[, options])
fs.readlinkSync(path[, options])
fs.readSync(fd, buffer, offset, length[, position])
fs.readSync(fd, buffer[, options])
fs.readvSync(fd, buffers[, position])
fs.realpathSync(path[, options])
fs.realpathSync.native(path[, options])
fs.renameSync(oldPath, newPath)
fs.rmdirSync(path[, options])
fs.rmSync(path[, options])
fs.statSync(path[, options])
fs.symlinkSync(target, path[, type])
fs.truncateSync(path[, len])
fs.unlinkSync(path)
fs.utimesSync(path, atime, mtime)
fs.writeFileSync(file, data[, options])
fs.writeSync(fd, buffer, offset[, length[, position]])
fs.writeSync(fd, buffer[, options])
fs.writeSync(fd, string[, position[, encoding]])
fs.writevSync(fd, buffers[, position])
- Common Objects
- Class:
fs.Dir
- Class:
fs.Dirent
- Class:
fs.FSWatcher
- Class:
fs.StatWatcher
- Class:
fs.ReadStream
- Class:
fs.Stats
stats.isBlockDevice()
stats.isCharacterDevice()
stats.isDirectory()
stats.isFIFO()
stats.isFile()
stats.isSocket()
stats.isSymbolicLink()
stats.dev
stats.ino
stats.mode
stats.nlink
stats.uid
stats.gid
stats.rdev
stats.size
stats.blksize
stats.blocks
stats.atimeMs
stats.mtimeMs
stats.ctimeMs
stats.birthtimeMs
stats.atimeNs
stats.mtimeNs
stats.ctimeNs
stats.birthtimeNs
stats.atime
stats.mtime
stats.ctime
stats.birthtime
- Stat time values
- Class:
fs.WriteStream
fs.constants
- Class:
- Notes
- Global objects
- 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
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
- Class:
- HTTP
- Class:
http.Agent
- Class:
http.ClientRequest
- Event:
'abort'
- Event:
'close'
- Event:
'connect'
- Event:
'continue'
- Event:
'finish'
- Event:
'information'
- Event:
'response'
- Event:
'socket'
- Event:
'timeout'
- Event:
'upgrade'
request.abort()
request.aborted
request.connection
request.cork()
request.end([data[, encoding]][, callback])
request.destroy([error])
request.finished
request.flushHeaders()
request.getHeader(name)
request.getHeaderNames()
request.getHeaders()
request.getRawHeaderNames()
request.hasHeader(name)
request.maxHeadersCount
request.path
request.method
request.host
request.protocol
request.removeHeader(name)
request.reusedSocket
request.setHeader(name, value)
request.setNoDelay([noDelay])
request.setSocketKeepAlive([enable][, initialDelay])
request.setTimeout(timeout[, callback])
request.socket
request.uncork()
request.writableEnded
request.writableFinished
request.write(chunk[, encoding][, callback])
- Event:
- Class:
http.Server
- Event:
'checkContinue'
- Event:
'checkExpectation'
- Event:
'clientError'
- Event:
'close'
- Event:
'connect'
- Event:
'connection'
- Event:
'dropRequest'
- Event:
'request'
- Event:
'upgrade'
server.close([callback])
server.closeAllConnections()
server.closeIdleConnections()
server.headersTimeout
server.listen()
server.listening
server.maxHeadersCount
server.requestTimeout
server.setTimeout([msecs][, callback])
server.maxRequestsPerSocket
server.timeout
server.keepAliveTimeout
- Event:
- Class:
http.ServerResponse
- Event:
'close'
- Event:
'finish'
response.addTrailers(headers)
response.connection
response.cork()
response.end([data[, encoding]][, callback])
response.finished
response.flushHeaders()
response.getHeader(name)
response.getHeaderNames()
response.getHeaders()
response.hasHeader(name)
response.headersSent
response.removeHeader(name)
response.req
response.sendDate
response.setHeader(name, value)
response.setTimeout(msecs[, callback])
response.socket
response.statusCode
response.statusMessage
response.uncork()
response.writableEnded
response.writableFinished
response.write(chunk[, encoding][, callback])
response.writeContinue()
response.writeEarlyHints(hints[, callback])
response.writeHead(statusCode[, statusMessage][, headers])
response.writeProcessing()
- Event:
- Class:
http.IncomingMessage
- Event:
'aborted'
- Event:
'close'
message.aborted
message.complete
message.connection
message.destroy([error])
message.headers
message.headersDistinct
message.httpVersion
message.method
message.rawHeaders
message.rawTrailers
message.setTimeout(msecs[, callback])
message.socket
message.statusCode
message.statusMessage
message.trailers
message.trailersDistinct
message.url
- Event:
- Class:
http.OutgoingMessage
- Event:
'drain'
- Event:
'finish'
- Event:
'prefinish'
outgoingMessage.addTrailers(headers)
outgoingMessage.appendHeader(name, value)
outgoingMessage.connection
outgoingMessage.cork()
outgoingMessage.destroy([error])
outgoingMessage.end(chunk[, encoding][, callback])
outgoingMessage.flushHeaders()
outgoingMessage.getHeader(name)
outgoingMessage.getHeaderNames()
outgoingMessage.getHeaders()
outgoingMessage.hasHeader(name)
outgoingMessage.headersSent
outgoingMessage.pipe()
outgoingMessage.removeHeader(name)
outgoingMessage.setHeader(name, value)
outgoingMessage.setTimeout(msesc[, callback])
outgoingMessage.socket
outgoingMessage.uncork()
outgoingMessage.writableCorked
outgoingMessage.writableEnded
outgoingMessage.writableFinished
outgoingMessage.writableHighWaterMark
outgoingMessage.writableLength
outgoingMessage.writableObjectMode
outgoingMessage.write(chunk[, encoding][, callback])
- Event:
http.METHODS
http.STATUS_CODES
http.createServer([options][, requestListener])
http.get(options[, callback])
http.get(url[, options][, callback])
http.globalAgent
http.maxHeaderSize
http.request(options[, callback])
http.request(url[, options][, callback])
http.validateHeaderName(name)
http.validateHeaderValue(name, value)
http.setMaxIdleHTTPParsers
- Class:
- HTTP/2
- Determining if crypto support is unavailable
- Core API
- Server-side example
- Client-side example
- Class:
Http2Session
Http2Session
and sockets- Event:
'close'
- Event:
'connect'
- Event:
'error'
- Event:
'frameError'
- Event:
'goaway'
- Event:
'localSettings'
- Event:
'ping'
- Event:
'remoteSettings'
- Event:
'stream'
- Event:
'timeout'
http2session.alpnProtocol
http2session.close([callback])
http2session.closed
http2session.connecting
http2session.destroy([error][, code])
http2session.destroyed
http2session.encrypted
http2session.goaway([code[, lastStreamID[, opaqueData]]])
http2session.localSettings
http2session.originSet
http2session.pendingSettingsAck
http2session.ping([payload, ]callback)
http2session.ref()
http2session.remoteSettings
http2session.setLocalWindowSize(windowSize)
http2session.setTimeout(msecs, callback)
http2session.socket
http2session.state
http2session.settings([settings][, callback])
http2session.type
http2session.unref()
- Class:
ServerHttp2Session
- Class:
ClientHttp2Session
- Class:
Http2Stream
Http2Stream
Lifecycle- Event:
'aborted'
- Event:
'close'
- Event:
'error'
- Event:
'frameError'
- Event:
'ready'
- Event:
'timeout'
- Event:
'trailers'
- Event:
'wantTrailers'
http2stream.aborted
http2stream.bufferSize
http2stream.close(code[, callback])
http2stream.closed
http2stream.destroyed
http2stream.endAfterHeaders
http2stream.id
http2stream.pending
http2stream.priority(options)
http2stream.rstCode
http2stream.sentHeaders
http2stream.sentInfoHeaders
http2stream.sentTrailers
http2stream.session
http2stream.setTimeout(msecs, callback)
http2stream.state
http2stream.sendTrailers(headers)
- Class:
ClientHttp2Stream
- Class:
ServerHttp2Stream
- Class:
Http2Server
- Class:
Http2SecureServer
http2.createServer([options][, onRequestHandler])
http2.createSecureServer(options[, onRequestHandler])
http2.connect(authority[, options][, listener])
http2.constants
http2.getDefaultSettings()
http2.getPackedSettings([settings])
http2.getUnpackedSettings(buf)
http2.sensitiveHeaders
- Headers object
- Settings object
- Error handling
- Invalid character handling in header names and values
- Push streams on the client
- Supporting the
CONNECT
method - The extended
CONNECT
protocol
- Compatibility API
- ALPN negotiation
- Class:
http2.Http2ServerRequest
- Event:
'aborted'
- Event:
'close'
request.aborted
request.authority
request.complete
request.connection
request.destroy([error])
request.headers
request.httpVersion
request.method
request.rawHeaders
request.rawTrailers
request.scheme
request.setTimeout(msecs, callback)
request.socket
request.stream
request.trailers
request.url
- Event:
- Class:
http2.Http2ServerResponse
- Event:
'close'
- Event:
'finish'
response.addTrailers(headers)
response.connection
response.createPushResponse(headers, callback)
response.end([data[, encoding]][, callback])
response.finished
response.getHeader(name)
response.getHeaderNames()
response.getHeaders()
response.hasHeader(name)
response.headersSent
response.removeHeader(name)
- Event:
response.req
response.writeEarlyHints(links)
- Collecting HTTP/2 performance metrics
- Note on
:authority
andhost
- HTTPS
- Inspector
- Internationalization support
- Modules: CommonJS modules
- Enabling
- Accessing the main module
- Package manager tips
- The
.mjs
extension - All together
- Caching
- Core modules
- Cycles
- File modules
- Folders as modules
- Loading from
node_modules
folders - Loading from the global folders
- The module wrapper
- The module scope
- The
module
object - The
Module
object - Source map v3 support
- Modules: ECMAScript modules
- Modules:
node:module
API - Modules: Packages
- Net
- IPC support
- Class:
net.BlockList
- Class:
net.SocketAddress
- Class:
net.Server
- Class:
net.Socket
new net.Socket([options])
- Event:
'close'
- Event:
'connect'
- Event:
'data'
- Event:
'drain'
- Event:
'end'
- Event:
'error'
- Event:
'lookup'
- Event:
'ready'
- Event:
'timeout'
socket.address()
socket.bufferSize
socket.bytesRead
socket.bytesWritten
socket.connect()
socket.connecting
socket.destroy([error])
socket.destroyed
socket.end([data[, encoding]][, callback])
socket.localAddress
socket.localPort
socket.localFamily
socket.pause()
socket.pending
socket.ref()
socket.remoteAddress
socket.remoteFamily
socket.remotePort
socket.resetAndDestroy()
socket.resume()
socket.setEncoding([encoding])
socket.setKeepAlive([enable][, initialDelay])
socket.setNoDelay([noDelay])
socket.setTimeout(timeout[, callback])
socket.timeout
socket.unref()
socket.write(data[, encoding][, callback])
socket.readyState
net.connect()
net.createConnection()
net.createServer([options][, connectionListener])
net.isIP(input)
net.isIPv4(input)
net.isIPv6(input)
- OS
os.EOL
os.arch()
os.constants
os.cpus()
os.devNull
os.endianness()
os.freemem()
os.getPriority([pid])
os.homedir()
os.hostname()
os.loadavg()
os.networkInterfaces()
os.platform()
os.release()
os.setPriority([pid, ]priority)
os.tmpdir()
os.totalmem()
os.type()
os.uptime()
os.userInfo([options])
os.version()
os.machine()
- OS constants
- Path
- Windows vs. POSIX
path.basename(path[, suffix])
path.delimiter
path.dirname(path)
path.extname(path)
path.format(pathObject)
path.isAbsolute(path)
path.join([...paths])
path.normalize(path)
path.parse(path)
path.posix
path.relative(from, to)
path.resolve([...paths])
path.sep
path.toNamespacedPath(path)
path.win32
- Performance measurement APIs
perf_hooks.performance
performance.clearMarks([name])
performance.clearMeasures([name])
performance.clearResourceTimings([name])
performance.eventLoopUtilization([utilization1[, utilization2]])
performance.getEntries()
performance.getEntriesByName(name[, type])
performance.getEntriesByType(type)
performance.mark([name[, options]])
performance.markResourceTiming(timingInfo, requestedUrl, initiatorType, global, cacheMode)
performance.measure(name[, startMarkOrOptions[, endMark]])
performance.nodeTiming
performance.now()
performance.setResourceTimingBufferSize(maxSize)
performance.timeOrigin
performance.timerify(fn[, options])
performance.toJSON()
- Class:
PerformanceEntry
performanceEntry.detail
performanceEntry.duration
performanceEntry.entryType
performanceEntry.flags
performanceEntry.name
performanceEntry.kind
performanceEntry.startTime
- Garbage Collection ('gc') Details
- HTTP ('http') Details
- HTTP/2 ('http2') Details
- Timerify ('function') Details
- Net ('net') Details
- DNS ('dns') Details
- Class:
PerformanceNodeTiming
- Class:
PerformanceResourceTiming
performanceResourceTiming.workerStart
performanceResourceTiming.redirectStart
performanceResourceTiming.redirectEnd
performanceResourceTiming.fetchStart
performanceResourceTiming.domainLookupStart
performanceResourceTiming.domainLookupEnd
performanceResourceTiming.connectStart
performanceResourceTiming.connectEnd
performanceResourceTiming.secureConnectionStart
performanceResourceTiming.requestStart
performanceResourceTiming.responseEnd
performanceResourceTiming.transferSize
performanceResourceTiming.encodedBodySize
performanceResourceTiming.decodedBodySize
performanceResourceTiming.toJSON()
- Class:
perf_hooks.PerformanceObserver
- Class:
PerformanceObserverEntryList
perf_hooks.createHistogram([options])
perf_hooks.monitorEventLoopDelay([options])
- Class:
Histogram
histogram.count
histogram.countBigInt
histogram.exceeds
histogram.exceedsBigInt
histogram.max
histogram.maxBigInt
histogram.mean
histogram.min
histogram.minBigInt
histogram.percentile(percentile)
histogram.percentileBigInt(percentile)
histogram.percentiles
histogram.percentilesBigInt
histogram.reset()
histogram.stddev
- Class:
IntervalHistogram extends Histogram
- Class:
RecordableHistogram extends Histogram
- Examples
- Permissions
- Process
- Process events
process.abort()
process.allowedNodeEnvironmentFlags
process.arch
process.argv
process.argv0
process.channel
process.chdir(directory)
process.config
process.connected
process.cpuUsage([previousValue])
process.cwd()
process.debugPort
process.disconnect()
process.dlopen(module, filename[, flags])
process.emitWarning(warning[, options])
process.emitWarning(warning[, type[, code]][, ctor])
process.env
process.execArgv
process.execPath
process.exit([code])
process.exitCode
process.getActiveResourcesInfo()
process.getegid()
process.geteuid()
process.getgid()
process.getgroups()
process.getuid()
process.hasUncaughtExceptionCaptureCallback()
process.hrtime([time])
process.hrtime.bigint()
process.initgroups(user, extraGroup)
process.kill(pid[, signal])
process.mainModule
process.memoryUsage()
process.memoryUsage.rss()
process.nextTick(callback[, ...args])
process.noDeprecation
process.pid
process.platform
process.ppid
process.release
process.report
process.resourceUsage()
process.send(message[, sendHandle[, options]][, callback])
process.setegid(id)
process.seteuid(id)
process.setgid(id)
process.setgroups(groups)
process.setuid(id)
process.setSourceMapsEnabled(val)
process.setUncaughtExceptionCaptureCallback(fn)
process.stderr
process.stdin
process.stdout
process.throwDeprecation
process.title
process.traceDeprecation
process.umask()
process.umask(mask)
process.uptime()
process.version
process.versions
- Exit codes
- Punycode
- Query string
- Readline
- Class:
InterfaceConstructor
- Event:
'close'
- Event:
'line'
- Event:
'history'
- Event:
'pause'
- Event:
'resume'
- Event:
'SIGCONT'
- Event:
'SIGINT'
- Event:
'SIGTSTP'
rl.close()
rl.pause()
rl.prompt([preserveCursor])
rl.question(query[, options], callback)
rl.resume()
rl.setPrompt(prompt)
rl.getPrompt()
rl.write(data[, key])
rl[Symbol.asyncIterator]()
rl.line
rl.cursor
rl.getCursorPos()
- Event:
- Promises API
- Callback API
readline.emitKeypressEvents(stream[, interface])
- Example: Tiny CLI
- Example: Read file stream line-by-Line
- TTY keybindings
- Class:
- REPL
- Diagnostic report
- Stream
- Organization of this document
- Types of streams
- API for stream consumers
- Writable streams
- Class:
stream.Writable
- Event:
'close'
- Event:
'drain'
- Event:
'error'
- Event:
'finish'
- Event:
'pipe'
- Event:
'unpipe'
writable.cork()
writable.destroy([error])
writable.closed
writable.destroyed
writable.end([chunk[, encoding]][, callback])
writable.setDefaultEncoding(encoding)
writable.uncork()
writable.writable
writable.writableAborted
writable.writableEnded
writable.writableCorked
writable.errored
writable.writableFinished
writable.writableHighWaterMark
writable.writableLength
writable.writableNeedDrain
writable.writableObjectMode
writable.write(chunk[, encoding][, callback])
- Event:
- Class:
- Readable streams
- Two reading modes
- Three states
- Choose one API style
- Class:
stream.Readable
- Event:
'close'
- Event:
'data'
- Event:
'end'
- Event:
'error'
- Event:
'pause'
- Event:
'readable'
- Event:
'resume'
readable.destroy([error])
readable.closed
readable.destroyed
readable.isPaused()
readable.pause()
readable.pipe(destination[, options])
readable.read([size])
readable.readable
readable.readableAborted
readable.readableDidRead
readable.readableEncoding
readable.readableEnded
readable.errored
readable.readableFlowing
readable.readableHighWaterMark
readable.readableLength
readable.readableObjectMode
readable.resume()
readable.setEncoding(encoding)
readable.unpipe([destination])
readable.unshift(chunk[, encoding])
readable.wrap(stream)
readable[Symbol.asyncIterator]()
readable.iterator([options])
readable.map(fn[, options])
readable.filter(fn[, options])
readable.forEach(fn[, options])
readable.toArray([options])
readable.some(fn[, options])
readable.find(fn[, options])
readable.every(fn[, options])
readable.flatMap(fn[, options])
readable.drop(limit[, options])
readable.take(limit[, options])
readable.asIndexedPairs([options])
readable.reduce(fn[, initial[, options]])
- Event:
- Duplex and transform streams
stream.finished(stream[, options], callback)
stream.pipeline(source[, ...transforms], destination, callback)
stream.pipeline(streams, callback)
stream.compose(...streams)
stream.Readable.from(iterable[, options])
stream.Readable.fromWeb(readableStream[, options])
stream.Readable.isDisturbed(stream)
stream.isErrored(stream)
stream.isReadable(stream)
stream.Readable.toWeb(streamReadable[, options])
stream.Writable.fromWeb(writableStream[, options])
stream.Writable.toWeb(streamWritable)
stream.Duplex.from(src)
stream.Duplex.fromWeb(pair[, options])
stream.Duplex.toWeb(streamDuplex)
stream.addAbortSignal(signal, stream)
- Writable streams
- API for stream implementers
- Additional notes
- String decoder
- Test runner
- Subtests
- Skipping tests
describe
/it
syntax- Filtering tests by name
- Extraneous asynchronous activity
- Running tests from the command line
run([options])
test([name][, options][, fn])
describe([name][, options][, fn])
describe.skip([name][, options][, fn])
describe.todo([name][, options][, fn])
it([name][, options][, fn])
it.skip([name][, options][, fn])
it.todo([name][, options][, fn])
before([fn][, options])
after([fn][, options])
beforeEach([fn][, options])
afterEach([fn][, options])
- Class:
TapStream
- Class:
TestContext
- Class:
SuiteContext
- Timers
- TLS (SSL)
- Determining if crypto support is unavailable
- TLS/SSL concepts
- Modifying the default TLS cipher suite
- X509 certificate error codes
- Class:
tls.CryptoStream
- Class:
tls.SecurePair
- Class:
tls.Server
- Event:
'connection'
- Event:
'keylog'
- Event:
'newSession'
- Event:
'OCSPRequest'
- Event:
'resumeSession'
- Event:
'secureConnection'
- Event:
'tlsClientError'
server.addContext(hostname, context)
server.address()
server.close([callback])
server.getTicketKeys()
server.listen()
server.setSecureContext(options)
server.setTicketKeys(keys)
- Event:
- Class:
tls.TLSSocket
new tls.TLSSocket(socket[, options])
- Event:
'keylog'
- Event:
'OCSPResponse'
- Event:
'secureConnect'
- Event:
'session'
tlsSocket.address()
tlsSocket.authorizationError
tlsSocket.authorized
tlsSocket.disableRenegotiation()
tlsSocket.enableTrace()
tlsSocket.encrypted
tlsSocket.exportKeyingMaterial(length, label[, context])
tlsSocket.getCertificate()
tlsSocket.getCipher()
tlsSocket.getEphemeralKeyInfo()
tlsSocket.getFinished()
tlsSocket.getPeerCertificate([detailed])
tlsSocket.getPeerFinished()
tlsSocket.getPeerX509Certificate()
tlsSocket.getProtocol()
tlsSocket.getSession()
tlsSocket.getSharedSigalgs()
tlsSocket.getTLSTicket()
tlsSocket.getX509Certificate()
tlsSocket.isSessionReused()
tlsSocket.localAddress
tlsSocket.localPort
tlsSocket.remoteAddress
tlsSocket.remoteFamily
tlsSocket.remotePort
tlsSocket.renegotiate(options, callback)
tlsSocket.setMaxSendFragment(size)
tls.checkServerIdentity(hostname, cert)
tls.connect(options[, callback])
tls.connect(path[, options][, callback])
tls.connect(port[, host][, options][, callback])
tls.createSecureContext([options])
tls.createSecurePair([context][, isServer][, requestCert][, rejectUnauthorized][, options])
tls.createServer([options][, secureConnectionListener])
tls.getCiphers()
tls.rootCertificates
tls.DEFAULT_ECDH_CURVE
tls.DEFAULT_MAX_VERSION
tls.DEFAULT_MIN_VERSION
- Trace events
- TTY
- Class:
tty.ReadStream
- Class:
tty.WriteStream
- Event:
'resize'
writeStream.clearLine(dir[, callback])
writeStream.clearScreenDown([callback])
writeStream.columns
writeStream.cursorTo(x[, y][, callback])
writeStream.getColorDepth([env])
writeStream.getWindowSize()
writeStream.hasColors([count][, env])
writeStream.isTTY
writeStream.moveCursor(dx, dy[, callback])
writeStream.rows
- Event:
tty.isatty(fd)
- Class:
- UDP/datagram sockets
- Class:
dgram.Socket
- Event:
'close'
- Event:
'connect'
- Event:
'error'
- Event:
'listening'
- Event:
'message'
socket.addMembership(multicastAddress[, multicastInterface])
socket.addSourceSpecificMembership(sourceAddress, groupAddress[, multicastInterface])
socket.address()
socket.bind([port][, address][, callback])
socket.bind(options[, callback])
socket.close([callback])
socket.connect(port[, address][, callback])
socket.disconnect()
socket.dropMembership(multicastAddress[, multicastInterface])
socket.dropSourceSpecificMembership(sourceAddress, groupAddress[, multicastInterface])
socket.getRecvBufferSize()
socket.getSendBufferSize()
socket.getSendQueueSize()
socket.getSendQueueCount()
socket.ref()
socket.remoteAddress()
socket.send(msg[, offset, length][, port][, address][, callback])
socket.setBroadcast(flag)
socket.setMulticastInterface(multicastInterface)
socket.setMulticastLoopback(flag)
socket.setMulticastTTL(ttl)
socket.setRecvBufferSize(size)
socket.setSendBufferSize(size)
socket.setTTL(ttl)
socket.unref()
- Event:
node:dgram
module functions
- Class:
- URL
- URL strings and URL objects
- The WHATWG URL API
- Class:
URL
- Class:
URLSearchParams
new URLSearchParams()
new URLSearchParams(string)
new URLSearchParams(obj)
new URLSearchParams(iterable)
urlSearchParams.append(name, value)
urlSearchParams.delete(name)
urlSearchParams.entries()
urlSearchParams.forEach(fn[, thisArg])
urlSearchParams.get(name)
urlSearchParams.getAll(name)
urlSearchParams.has(name)
urlSearchParams.keys()
urlSearchParams.set(name, value)
urlSearchParams.sort()
urlSearchParams.toString()
urlSearchParams.values()
urlSearchParams[Symbol.iterator]()
url.domainToASCII(domain)
url.domainToUnicode(domain)
url.fileURLToPath(url)
url.format(URL[, options])
url.pathToFileURL(path)
url.urlToHttpOptions(url)
- Class:
- Legacy URL API
- Percent-encoding in URLs
- Util
util.callbackify(original)
util.debuglog(section[, callback])
util.debug(section)
util.deprecate(fn, msg[, code])
util.format(format[, ...args])
util.formatWithOptions(inspectOptions, format[, ...args])
util.getSystemErrorName(err)
util.getSystemErrorMap()
util.inherits(constructor, superConstructor)
util.inspect(object[, options])
util.inspect(object[, showHidden[, depth[, colors]]])
util.isDeepStrictEqual(val1, val2)
util.parseArgs([config])
util.promisify(original)
util.stripVTControlCharacters(str)
- Class:
util.TextDecoder
- Class:
util.TextEncoder
util.toUSVString(string)
util.transferableAbortController()
util.transferableAbortSignal(signal)
util.types
util.types.isAnyArrayBuffer(value)
util.types.isArrayBufferView(value)
util.types.isArgumentsObject(value)
util.types.isArrayBuffer(value)
util.types.isAsyncFunction(value)
util.types.isBigInt64Array(value)
util.types.isBigUint64Array(value)
util.types.isBooleanObject(value)
util.types.isBoxedPrimitive(value)
util.types.isCryptoKey(value)
util.types.isDataView(value)
util.types.isDate(value)
util.types.isExternal(value)
util.types.isFloat32Array(value)
util.types.isFloat64Array(value)
util.types.isGeneratorFunction(value)
util.types.isGeneratorObject(value)
util.types.isInt8Array(value)
util.types.isInt16Array(value)
util.types.isInt32Array(value)
util.types.isKeyObject(value)
util.types.isMap(value)
util.types.isMapIterator(value)
util.types.isModuleNamespaceObject(value)
util.types.isNativeError(value)
util.types.isNumberObject(value)
util.types.isPromise(value)
util.types.isProxy(value)
util.types.isRegExp(value)
util.types.isSet(value)
util.types.isSetIterator(value)
util.types.isSharedArrayBuffer(value)
util.types.isStringObject(value)
util.types.isSymbolObject(value)
util.types.isTypedArray(value)
util.types.isUint8Array(value)
util.types.isUint8ClampedArray(value)
util.types.isUint16Array(value)
util.types.isUint32Array(value)
util.types.isWeakMap(value)
util.types.isWeakSet(value)
util.types.isWebAssemblyCompiledModule(value)
- Deprecated APIs
util._extend(target, source)
util.isArray(object)
util.isBoolean(object)
util.isBuffer(object)
util.isDate(object)
util.isError(object)
util.isFunction(object)
util.isNull(object)
util.isNullOrUndefined(object)
util.isNumber(object)
util.isObject(object)
util.isPrimitive(object)
util.isRegExp(object)
util.isString(object)
util.isSymbol(object)
util.isUndefined(object)
util.log(string)
- V8
v8.cachedDataVersionTag()
v8.getHeapCodeStatistics()
v8.getHeapSnapshot()
v8.getHeapSpaceStatistics()
v8.getHeapStatistics()
v8.setFlagsFromString(flags)
v8.stopCoverage()
v8.takeCoverage()
v8.writeHeapSnapshot([filename])
v8.setHeapSnapshotNearHeapLimit(limit)
- Serialization API
v8.serialize(value)
v8.deserialize(buffer)
- Class:
v8.Serializer
new Serializer()
serializer.writeHeader()
serializer.writeValue(value)
serializer.releaseBuffer()
serializer.transferArrayBuffer(id, arrayBuffer)
serializer.writeUint32(value)
serializer.writeUint64(hi, lo)
serializer.writeDouble(value)
serializer.writeRawBytes(buffer)
serializer._writeHostObject(object)
serializer._getDataCloneError(message)
serializer._getSharedArrayBufferId(sharedArrayBuffer)
serializer._setTreatArrayBufferViewsAsHostObjects(flag)
- Class:
v8.Deserializer
new Deserializer(buffer)
deserializer.readHeader()
deserializer.readValue()
deserializer.transferArrayBuffer(id, arrayBuffer)
deserializer.getWireFormatVersion()
deserializer.readUint32()
deserializer.readUint64()
deserializer.readDouble()
deserializer.readRawBytes(length)
deserializer._readHostObject()
- Class:
v8.DefaultSerializer
- Class:
v8.DefaultDeserializer
- Promise hooks
- Startup Snapshot API
- VM (executing JavaScript)
- Class:
vm.Script
- Class:
vm.Module
- Class:
vm.SourceTextModule
- Class:
vm.SyntheticModule
vm.compileFunction(code[, params[, options]])
vm.createContext([contextObject[, options]])
vm.isContext(object)
vm.measureMemory([options])
vm.runInContext(code, contextifiedObject[, options])
vm.runInNewContext(code[, contextObject[, options]])
vm.runInThisContext(code[, options])
- Example: Running an HTTP server within a VM
- What does it mean to "contextify" an object?
- Timeout interactions with asynchronous tasks and Promises
- Class:
- WebAssembly System Interface (WASI)
- Web Crypto API
- Examples
- Algorithm matrix
- Class:
Crypto
- Class:
CryptoKey
- Class:
CryptoKeyPair
- Class:
SubtleCrypto
subtle.decrypt(algorithm, key, data)
subtle.deriveBits(algorithm, baseKey, length)
subtle.deriveKey(algorithm, baseKey, derivedKeyAlgorithm, extractable, keyUsages)
subtle.digest(algorithm, data)
subtle.encrypt(algorithm, key, data)
subtle.exportKey(format, key)
subtle.generateKey(algorithm, extractable, keyUsages)
subtle.importKey(format, keyData, algorithm, extractable, keyUsages)
subtle.sign(algorithm, key, data)
subtle.unwrapKey(format, wrappedKey, unwrappingKey, unwrapAlgo, unwrappedKeyAlgo, extractable, keyUsages)
subtle.verify(algorithm, key, signature, data)
subtle.wrapKey(format, key, wrappingKey, wrapAlgo)
- Algorithm parameters
- Class:
AlgorithmIdentifier
- Class:
AesCbcParams
- Class:
AesCtrParams
- Class:
AesGcmParams
- Class:
AesKeyGenParams
- Class:
EcdhKeyDeriveParams
- Class:
EcdsaParams
- Class:
EcKeyGenParams
- Class:
EcKeyImportParams
- Class:
Ed448Params
- Class:
HkdfParams
- Class:
HmacImportParams
- Class:
HmacKeyGenParams
- Class:
Pbkdf2Params
- Class:
RsaHashedImportParams
- Class:
RsaHashedKeyGenParams
- Class:
RsaOaepParams
- Class:
RsaPssParams
- Class:
- Web Streams API
- Overview
- API
- Class:
ReadableStream
new ReadableStream([underlyingSource [, strategy]])
readableStream.locked
readableStream.cancel([reason])
readableStream.getReader([options])
readableStream.pipeThrough(transform[, options])
readableStream.pipeTo(destination, options)
readableStream.tee()
readableStream.values([options])
- Async Iteration
- Transferring with
postMessage()
- Class:
ReadableStreamDefaultReader
- Class:
ReadableStreamBYOBReader
- Class:
ReadableStreamDefaultController
- Class:
ReadableByteStreamController
- Class:
ReadableStreamBYOBRequest
- Class:
WritableStream
- Class:
WritableStreamDefaultWriter
new WritableStreamDefaultWriter(stream)
writableStreamDefaultWriter.abort([reason])
writableStreamDefaultWriter.close()
writableStreamDefaultWriter.closed
writableStreamDefaultWriter.desiredSize
writableStreamDefaultWriter.ready
writableStreamDefaultWriter.releaseLock()
writableStreamDefaultWriter.write([chunk])
- Class:
WritableStreamDefaultController
- Class:
TransformStream
- Class:
TransformStreamDefaultController
- Class:
ByteLengthQueuingStrategy
- Class:
CountQueuingStrategy
- Class:
TextEncoderStream
- Class:
TextDecoderStream
- Class:
CompressionStream
- Class:
DecompressionStream
- Utility Consumers
- Class:
- Worker threads
worker.getEnvironmentData(key)
worker.isMainThread
worker.markAsUntransferable(object)
worker.moveMessagePortToContext(port, contextifiedSandbox)
worker.parentPort
worker.receiveMessageOnPort(port)
worker.resourceLimits
worker.SHARE_ENV
worker.setEnvironmentData(key[, value])
worker.threadId
worker.workerData
- Class:
BroadcastChannel extends EventTarget
- Class:
MessageChannel
- Class:
MessagePort
- Class:
Worker
new Worker(filename[, options])
- Event:
'error'
- Event:
'exit'
- Event:
'message'
- Event:
'messageerror'
- Event:
'online'
worker.getHeapSnapshot()
worker.performance
worker.postMessage(value[, transferList])
worker.ref()
worker.resourceLimits
worker.stderr
worker.stdin
worker.stdout
worker.terminate()
worker.threadId
worker.unref()
- Notes
- Zlib
- Threadpool usage and performance considerations
- Compressing HTTP requests and responses
- Memory usage tuning
- Flushing
- Constants
- Class:
Options
- Class:
BrotliOptions
- Class:
zlib.BrotliCompress
- Class:
zlib.BrotliDecompress
- Class:
zlib.Deflate
- Class:
zlib.DeflateRaw
- Class:
zlib.Gunzip
- Class:
zlib.Gzip
- Class:
zlib.Inflate
- Class:
zlib.InflateRaw
- Class:
zlib.Unzip
- Class:
zlib.ZlibBase
zlib.constants
zlib.createBrotliCompress([options])
zlib.createBrotliDecompress([options])
zlib.createDeflate([options])
zlib.createDeflateRaw([options])
zlib.createGunzip([options])
zlib.createGzip([options])
zlib.createInflate([options])
zlib.createInflateRaw([options])
zlib.createUnzip([options])
- Convenience methods
zlib.brotliCompress(buffer[, options], callback)
zlib.brotliCompressSync(buffer[, options])
zlib.brotliDecompress(buffer[, options], callback)
zlib.brotliDecompressSync(buffer[, options])
zlib.deflate(buffer[, options], callback)
zlib.deflateSync(buffer[, options])
zlib.deflateRaw(buffer[, options], callback)
zlib.deflateRawSync(buffer[, options])
zlib.gunzip(buffer[, options], callback)
zlib.gunzipSync(buffer[, options])
zlib.gzip(buffer[, options], callback)
zlib.gzipSync(buffer[, options])
zlib.inflate(buffer[, options], callback)
zlib.inflateSync(buffer[, options])
zlib.inflateRaw(buffer[, options], callback)
zlib.inflateRawSync(buffer[, options])
zlib.unzip(buffer[, options], callback)
zlib.unzipSync(buffer[, options])