- Assertion Testing
- Async Hooks
- Buffer
- C++ Addons
- C/C++ Addons - N-API
- Child Processes
- Cluster
- Command Line Options
- Console
- Crypto
- Debugger
- Deprecated APIs
- DNS
- Domain
- ECMAScript Modules
- Errors
- Events
- File System
- Globals
- HTTP
- HTTP/2
- HTTPS
- Inspector
- Internationalization
- Modules
- Net
- OS
- Path
- Performance Hooks
- Policies
- Process
- Punycode
- Query Strings
- Readline
- REPL
- Report
- Stream
- String Decoder
- Timers
- TLS/SSL
- Trace Events
- TTY
- UDP/Datagram
- URL
- Utilities
- V8
- VM
- Worker Threads
- Zlib
Node.js v11.15.0 Documentation
Table of Contents
-
- Revoking deprecations
-
- 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 with worker.exitedAfterDisconnect
- DEP0008: require('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('sys')
- DEP0026: util.print()
- DEP0027: util.puts()
- DEP0028: util.debug()
- DEP0029: util.error()
- DEP0030: SlowBuffer
- DEP0031: ecdh.setPublicKey()
- DEP0032: 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: 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 and NODE_REPL_MODE=magic
- DEP0066: outgoingMessage._headers, outgoingMessage._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 to false
- DEP0084: requiring bundled internal dependencies
- DEP0085: AsyncHooks Sensitive API
- DEP0086: Remove runInAsyncIdScope
- DEP0089: require('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 with domain property
- DEP0098: AsyncHooks Embedder AsyncResource.emitBefore and AsyncResource.emitAfter APIs
- DEP0099: async context-unaware node::MakeCallback C++ APIs
- DEP0100: process.assert()
- DEP0101: --with-lttng
- DEP0102: Using
noAssert
in Buffer#(read|write) operations. - DEP0103: process.binding('util').is[...] typechecks
- DEP0104: process.env string coercion
- DEP0105: decipher.finaltol
- DEP0106: crypto.createCipher and crypto.createDecipher
- DEP0107: tls.convertNPNProtocols()
- DEP0108: zlib.bytesRead
- DEP0109: http, https, and tls 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 hostname
- DEP0119: process.binding('uv').errname() private API
- DEP0120: Windows Performance Counter Support
- DEP0126: timers.active()
- DEP0127: timers._unrefActive()
- DEP0129: ChildProcess._channel
Deprecated APIs#
Node.js may deprecate APIs when either: (a) use of the API is considered to be unsafe, (b) an improved alternative API is available, or (c) breaking changes to the API are expected in a future major release.
Node.js utilizes three kinds of Deprecations:
- Documentation-only
- Runtime
- End-of-Life
A Documentation-only deprecation is one that is expressed only within the
Node.js API docs. These generate no side-effects while running Node.js.
Some Documentation-only deprecations trigger a runtime warning when launched
with --pending-deprecation
flag (or its alternative,
NODE_PENDING_DEPRECATION=1
environment variable), similarly to Runtime
deprecations below. Documentation-only deprecations that support that flag
are explicitly labeled as such in the
list of Deprecated APIs.
A Runtime deprecation will, by default, generate a process warning that will
be printed to stderr
the first time the deprecated API is used. When the
--throw-deprecation
command-line flag is used, a Runtime deprecation will
cause an error to be thrown.
An End-of-Life deprecation is used when functionality is or will soon be removed from Node.js.
Revoking deprecations#
Occasionally, the deprecation of an API may be reversed. In such situations, this document will be updated with information relevant to the decision. However, the deprecation identifier will not be modified.
List of Deprecated APIs#
DEP0001: http.OutgoingMessage.prototype.flush#
Type: Runtime
The OutgoingMessage.prototype.flush()
method is deprecated. Use
OutgoingMessage.prototype.flushHeaders()
instead.
DEP0002: require('_linklist')#
Type: End-of-Life
The _linklist
module is deprecated. Please use a userland alternative.
DEP0003: _writableState.buffer#
Type: Runtime
The _writableState.buffer
property is deprecated. Use the
_writableState.getBuffer()
method instead.
DEP0004: CryptoStream.prototype.readyState#
Type: End-of-Life
The CryptoStream.prototype.readyState
property was removed.
DEP0005: Buffer() constructor#
Type: Runtime (supports --pending-deprecation
)
The Buffer()
function and new Buffer()
constructor are deprecated due to
API usability issues that can potentially lead to accidental security issues.
As an alternative, use of the following methods of constructing Buffer
objects
is strongly recommended:
Buffer.alloc(size[, fill[, encoding]])
- Create aBuffer
with initialized memory.Buffer.allocUnsafe(size)
- Create aBuffer
with uninitialized memory.Buffer.allocUnsafeSlow(size)
- Create aBuffer
with uninitialized memory.Buffer.from(array)
- Create aBuffer
with a copy ofarray
Buffer.from(arrayBuffer[, byteOffset[, length]])
- Create aBuffer
that wraps the givenarrayBuffer
.Buffer.from(buffer)
- Create aBuffer
that copiesbuffer
.Buffer.from(string[, encoding])
- Create aBuffer
that copiesstring
.
As of v10.0.0, a deprecation warning is printed at runtime when
--pending-deprecation
is used or when the calling code is
outside node_modules
in order to better target developers, rather than users.
DEP0006: child_process options.customFds#
Type: Runtime
Within the child_process
module's spawn()
, fork()
, and exec()
methods, the options.customFds
option is deprecated. The options.stdio
option should be used instead.
DEP0007: Replace cluster worker.suicide with worker.exitedAfterDisconnect#
Type: End-of-Life
In an earlier version of the Node.js cluster
, a boolean property with the name
suicide
was added to the Worker
object. The intent of this property was to
provide an indication of how and why the Worker
instance exited. In Node.js
6.0.0, the old property was deprecated and replaced with a new
worker.exitedAfterDisconnect
property. The old property name did not
precisely describe the actual semantics and was unnecessarily emotion-laden.
DEP0008: require('constants')#
Type: Documentation-only
The constants
module is deprecated. When requiring access to constants
relevant to specific Node.js builtin modules, developers should instead refer
to the constants
property exposed by the relevant module. For instance,
require('fs').constants
and require('os').constants
.
DEP0009: crypto.pbkdf2 without digest#
Type: Runtime
Use of the crypto.pbkdf2()
API without specifying a digest was deprecated
in Node.js 6.0 because the method defaulted to using the non-recommended
'SHA1'
digest. Previously, a deprecation warning was printed. Starting in
Node.js 8.0.0, calling crypto.pbkdf2()
or crypto.pbkdf2Sync()
with
digest
set to undefined
will throw a TypeError
.
Beginning in Node.js v11.0.0, calling these functions with digest
set to
null
will print a deprecation warning to align with the behavior when digest
is undefined
.
DEP0010: crypto.createCredentials#
Type: End-of-Life
The crypto.createCredentials()
API was removed. Please use
tls.createSecureContext()
instead.
DEP0011: crypto.Credentials#
Type: End-of-Life
The crypto.Credentials
class was removed. Please use tls.SecureContext
instead.
DEP0012: Domain.dispose#
Type: End-of-Life
Domain.dispose()
has been removed. Recover from failed I/O actions
explicitly via error event handlers set on the domain instead.
DEP0013: fs asynchronous function without callback#
Type: End-of-Life
Calling an asynchronous function without a callback throws a TypeError
in Node.js 10.0.0 onwards. (See https://github.com/nodejs/node/pull/12562.)
DEP0014: fs.read legacy String interface#
Type: End-of-Life
The fs.read()
legacy String
interface is deprecated. Use the Buffer
API as mentioned in the documentation instead.
DEP0015: fs.readSync legacy String interface#
Type: End-of-Life
The fs.readSync()
legacy String
interface is deprecated. Use the
Buffer
API as mentioned in the documentation instead.
DEP0016: GLOBAL/root#
Type: Runtime
The GLOBAL
and root
aliases for the global
property are deprecated
and should no longer be used.
DEP0017: Intl.v8BreakIterator#
Type: End-of-Life
Intl.v8BreakIterator
was a non-standard extension and has been removed.
See Intl.Segmenter
.
DEP0018: Unhandled promise rejections#
Type: Runtime
Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
DEP0019: require('.') resolved outside directory#
Type: Runtime
In certain cases, require('.')
may resolve outside the package directory.
This behavior is deprecated and will be removed in a future major Node.js
release.
DEP0020: Server.connections#
Type: Runtime
The Server.connections
property is deprecated. Please use the
Server.getConnections()
method instead.
DEP0021: Server.listenFD#
Type: Runtime
The Server.listenFD()
method is deprecated. Please use
Server.listen({fd: <number>})
instead.
DEP0022: os.tmpDir()#
Type: Runtime
The os.tmpDir()
API is deprecated. Please use os.tmpdir()
instead.
DEP0023: os.getNetworkInterfaces()#
Type: Runtime
The os.getNetworkInterfaces()
method is deprecated. Please use the
os.networkInterfaces
property instead.
DEP0024: REPLServer.prototype.convertToContext()#
Type: End-of-Life
The REPLServer.prototype.convertToContext()
API has been removed.
DEP0025: require('sys')#
Type: Runtime
The sys
module is deprecated. Please use the util
module instead.
DEP0026: util.print()#
Type: Runtime
The util.print()
API is deprecated. Please use console.log()
instead.
DEP0027: util.puts()#
Type: Runtime
The util.puts()
API is deprecated. Please use console.log()
instead.
DEP0028: util.debug()#
Type: Runtime
The util.debug()
API is deprecated. Please use console.error()
instead.
DEP0029: util.error()#
Type: Runtime
The util.error()
API is deprecated. Please use console.error()
instead.
DEP0030: SlowBuffer#
Type: Documentation-only
The SlowBuffer
class is deprecated. Please use
Buffer.allocUnsafeSlow(size)
instead.
DEP0031: ecdh.setPublicKey()#
Type: Documentation-only
The ecdh.setPublicKey()
method is now deprecated as its inclusion in the
API is not useful.
DEP0032: domain module#
Type: Documentation-only
The domain
module is deprecated and should not be used.
DEP0033: EventEmitter.listenerCount()#
Type: Documentation-only
The EventEmitter.listenerCount(emitter, eventName)
API is
deprecated. Please use emitter.listenerCount(eventName)
instead.
DEP0034: fs.exists(path, callback)[src]#
Type: Documentation-only
The fs.exists(path, callback)
API is deprecated. Please use
fs.stat()
or fs.access()
instead.
DEP0035: fs.lchmod(path, mode, callback)#
Type: Documentation-only
The fs.lchmod(path, mode, callback)
API is deprecated.
DEP0036: fs.lchmodSync(path, mode)#
Type: Documentation-only
The fs.lchmodSync(path, mode)
API is deprecated.
DEP0037: fs.lchown(path, uid, gid, callback)[src]#
Type: Deprecation revoked
The fs.lchown(path, uid, gid, callback)
API is deprecated.
DEP0038: fs.lchownSync(path, uid, gid)[src]#
Type: Deprecation revoked
The fs.lchownSync(path, uid, gid)
API is deprecated.
DEP0039: require.extensions#
Type: Documentation-only
The require.extensions
property is deprecated.
DEP0040: punycode module#
Type: Documentation-only
The punycode
module is deprecated. Please use a userland alternative
instead.
DEP0041: NODE_REPL_HISTORY_FILE environment variable#
Type: End-of-Life
The NODE_REPL_HISTORY_FILE
environment variable was removed. Please use
NODE_REPL_HISTORY
instead.
DEP0042: tls.CryptoStream#
Type: End-of-Life
The tls.CryptoStream
class was removed. Please use
tls.TLSSocket
instead.
DEP0043: tls.SecurePair#
Type: Documentation-only
The tls.SecurePair
class is deprecated. Please use
tls.TLSSocket
instead.
DEP0044: util.isArray()#
Type: Documentation-only
The util.isArray()
API is deprecated. Please use Array.isArray()
instead.
DEP0045: util.isBoolean()[src]#
Type: Documentation-only
The util.isBoolean()
API is deprecated.
DEP0046: util.isBuffer()#
Type: Documentation-only
The util.isBuffer()
API is deprecated. Please use
Buffer.isBuffer()
instead.
DEP0047: util.isDate()#
Type: Documentation-only
The