Drop Node.js 14 support
MIT License
npm 6
to npm 8
, convert package_lock.json
to lockfileVersion 2
#privateField
syntax instead of _pseudoPrivateField
or closures for "Information Hiding" principlecluster.isMaster
to cluster.isPrimary
, change cluster.setupMaster
to cluster.setupPrimary
require
calls to use node:
prefix for all internal node.js modules, for example: node:fs
crypto.randomUUID()
to generate UUID instead of manual generation or third-party modulesfs.exists
; use fs.stat
or fs.access
instead, see example:const toBool = [() => true, () => false];
const exists = await fs.promises.access(filePath).then(...toBool);
fs.rmdir(path, { recursive: true })
; use fs.rm(path, { recursive: true })
instead, see docs: https://nodejs.org/api/fs.html#fsrmpath-options-callback
stream.destroyed
instead of the .aborted
property, and listen for close
event instead of abort
and aborted
events for ClientRequest
, ServerResponse
, and IncomingMessage
Server.connections
; use Server.getConnections()
instead, see docs: https://nodejs.org/api/net.html#servergetconnectionscallback
index.js
as of Node.js 16.0.0; the main entry point should be explicitly definedemitter.listeners
property; use emitter.listeners(eventName)
and events.getEventListeners(emitter, eventName)
instead to get copy of listeners collection, see docs: https://nodejs.org/api/events.html#eventsgeteventlistenersemitterortarget-eventname
response
(http.ServerResponse) has a reference to request
instance (http.IncomingMessage): response.req
node:url
API; use JavaScript URL class insteadprocess.on('uncaughtException', (reason, origin) => {})
handler to prevent process terminationprocess.on('multipleResolves', handler)
process.config
(frozen)Thenable
support in streamsprocess.exit(code)
and process.exitCode
http.createServer({ noDelay, keepAlive, keepAliveInitialDelay })
, no need in request.setNoDelay
anymoreos.machine()
returns one of machine types as a string: arm
, arm64
, aarch64
, mips
, mips64
, ppc64
, ppc64le
, s390
, s390x
, i386
, i686
, x86_64
Available in all currently supported Node.js versions as of April 2023
error.cause
to chain errors like: new Error('message', { cause: error })
, see docs: https://nodejs.org/api/errors.html#errorcause
AbortController
and AbortSignal
in different async I/O APIs: exec/fork/spawn
, events.once
, readFile
, stream.Writable/Readable
, and so onAsyncLocalStorage
, AsyncResource
, see docs: https://nodejs.org/api/async_context.html
node:stream/promises
, node:dns/promises
, node:assert/strict
node:timers/promises
, for example await setTimeout(100)
WeakReferences
and FinalizationRegistry
Promise
method any
node:http
improvements: server.maxRequestsPerSocket
, response.strictContentLength
, message.headersDistinct
, message.trailersDistinct
, outgoingMessage.appendHeader
, http.setMaxIdleHTTPParsers
, see docs: https://nodejs.org/api/http.html
node:crypto
Event
and EventTarget
classes: https://nodejs.org/api/events.html#eventtarget-and-event-api
BlockList
from node:net
: https://nodejs.org/api/net.html#class-netblocklist
createHistogram
, PerformanceMark
, getEntries
, PerformanceMeasure
, PerformanceResourceTiming
, multiple changes of PerformanceObserver
and Histogram
, new perf_hooks.performance
: https://nodejs.org/api/perf_hooks.html
node:worker_threads
features getEnvironmentData
and setEnvironmentData
, new classes BroadcastChannel
, EventTarget
, and MessagePort
, see docs: https://nodejs.org/api/worker_threads.html
node:test
: https://nodejs.org/api/test.html
node:net
changes: Server
event drop
, socket.connect
options: noDelay
, keepAlive
, and keepAliveInitialDelay
, socket.localFamily
, and socket.resetAndDestroy
node:v8
m see docs: https://nodejs.org/api/v8.html#promise-hooks
--watch
, process.getActiveResourcesInfo
, fs.cp
, and fsPromises.cp
, Readable
methods map
, filter
, compose
, iterator
, forEach
and so on--no-experimental-fetch
flag only from 18.0 and above, use undici
from npm for previous node.js versions: https://github.com/nodejs/undici
nodejs/undici
instead of npm modules request
, axios
, node-fetch
node:child_process
and node:worker_trheads
for CPU utilization and multithreading instead of node:cluster
ws
+ browser native implementation of Websocket
instead of socket.io
node:crypto.script
for password hashing or argon2
from npm instead of bcrypt
or other npm modulesnode:async_hooks
instead of zone.js
or deprecated built-in node.js domain
moduledocker
instead of pm2
or forever
npm modulesfastify
or native node:http
+ collection of routes Map<string, Function>
instead of archaic express
, connect
, koa
Intl
and ES6 built-in features instead of moment.js
${templateStrings}
instead of ejs
or other npm modules for templating