What's new in NodeJS 19?
NodeJS is one of the most influential things to happen in the field of web development.
A backend development environment built on Chrome's V8 engine (yes, fast like the Lamborghini)
But, did you know a new version has been released recently.
And it is NodeJS v19.
So, what are some of the features that have been introduced?
Let's look at them one by one.
1. node --watch
If you have created a server using NodeJS, you might be familiar to Nodemon.
A library used to listen to live updates in the code and restart the server as needed.
Previously NodeJS did not have this functionality. But with the gaining popularity of Nodemon, this was not far.
NodeJS v19 comes with the (experimental) flag --watch
that provides the same functionality of Nodemon.
node --watch index.js
2. HTTP(S)/1.1 KeepAlive by default
Starting with this release, Node.js sets keepAlive to true by default. This means that any outgoing HTTP(s) connection will automatically use HTTP 1.1 Keep-Alive. The default keep-alive duration is 5 seconds.
Enable keep-alive will deliver better throughput as connections are reused by default.
3. Stable Web Crypto
Chances are that you are familiar with Web3 and Blockchain. A native API exists that allows script to use cryptographic primitives in order to build systems using cryptography.
Use globalThis.crypto
or require('node:crypto').webcrypto
to access this module.
4. Dependencies - V8 10.7
The V8 engine is updated to version 10.7, which is part of Chromium 107. This version includes a new feature to the JavaScript API: Intl.NumberFormat
.
Intl.NumberFormat v3 API is a new TC39 ECMA402 stage 3 proposal extending the pre-existing Intl.NumberFormat.
5. NodeJS v18 going LTS
You might not know this but even versions of NodeJS are major releases, so the last major release NodeJS V18 is being given Long Term Support(LTS).
Also, since v19 is an odd version, the features are currently experimental.