Member-only story
What’s New in Node.js 15
Details of Node.js 15 new features, including throw on unhandled rejections and V8 8.6 language features

Node.js 15 was released October 20, 2020. It comes with a number of major features:
- Throw on unhandled rejections
- V8 8.6 language features
- NPM 7
- Experimental support for QUIC
- N-API Version 7
- Refinement of the Async Local Storage APIs
Let’s explore what they are and how to use them.
Use NVM to Explore Node
In a previous article, we provided instructions on using NVM (Node Version Manager) to manage Node.js and NPM versions. In our environment, we had Node.js 12.16.0
and NPM 6.14.8
installed. By running nvm install node
, we installed Node.js 15.4.0
and NPM7.0.15
.
We have two windows open, one is set to Node.js 12, and the other one is set to Node.js 15.
On the node12
window:
$ nvm use 12
Now using node v12.16.0 (npm v6.14.8)
On the node15
window:
$ nvm use 15
Now using node v15.4.0 (npm v7.0.15)
Now we’re ready to explore.
Throw On Unhandled Rejections
The unhandledRejection
event is emitted whenever a promise is rejected and no error handler is attached to the promise within a turn of the event loop. Starting from Node.js 15, the default mode for unhandledRejection
has been changed to throw
from warn
. In throw
mode, if an unhandledRejection
hook is not set, the unhandledRejection
is raised as an uncaught exception.
Create a program so that a promise is rejected with an error message:
When you run this code on node12
window it shows a long warning message:
$ node myPromise.js
(node:79104)…