Contents hide 1) Features of Node 16 1.1) Platform Support 1.2) V8 JavaScript Engine Version 9 1.3) Node-API Version 8 1.4) Stable Timers Promises API 1.5) Web Crypto API 1.6) Abort Controller 1.7) Buffer atob and btoa 1.8) npm v7 1.9) Async Local Storage APIs 1.10) Apple Silicon 1.11) Deprecations 2) Conclusion The latest version of Node is out recently, which will be moved to the LTS status soon. Node.js keeps up numerous versions including the current release alongside a long-term support (LTS) release. The official Node documentation mentions that every Node.js release will remain active for the first six months. Post that, if it is an odd number release like version 7 or 11, it becomes unsupported. However, if it is an even number it goes into the active long-term support or LTS mode. The LTS mode ensures that all the major bugs are fixed in 30 months. Since the release of the Node latest version is 20th April 2021, that evidently promotes Node 16 to the LTS release by October 2021 while continuing the maintenance till 2024. In this article, we shall study what’s new in Node 16. Let’s have a look at them. Release Date: April 20, 2021 Features of Node 16 Platform Support One of the fascinating features of Node 16 is the work being done to support the new Apple M1 structure. The Red Hat group is dynamic in the Node.js build working group, assisting with keeping the framework rushing to help the Power PC and s390 models, yet additionally assists with work across different structures. Additionally, this release supports the minimum levels for platforms and tooling that are used to build Node.js.This has helped every Nodejs development company by making it easier to build Node applications. Some of the examples of this are the support of Xcode version to 11 and the GCC version for Linux and AIX platforms to 8.3. V8 JavaScript Engine Version 9 The V8 JavaScript engine is the runtime environment that executes JavaScript code. It’s what allows JavaScript to stumble into numerous stages so engineers don’t have to stress over whether their code is running on Linux, Windows, macOS, or whether the equipment under the OS is x64, Arm, or Power PC. Nonetheless, V8 is written in C++ and requires the Node community to keep up and improve V8 for hardware combinations and assorted operating systems. Node-API Version 8 Node.js 16 features the journey of making it simpler to make, fabricate, and support native modules (also referred to as add-ons). Red Hat is one of the continuous supporters of NODE-API, and Node 16 accompanies NODE-API version 8, which incorporates new support for: Type tagging objects – napi_type_tag_object/napi_check_object_type_tag Freezing objects – napi_object_freeze Sealing objects – napi_object_seal The use cases have brought to the team the additions in each version of NODE-API from real-world use. Stable Timers Promises API In the previous version Node 15, the stable timers were available under an experimental status. These are now a stable feature as oe of the major changes in Node 16. import { setTimeout } from 'timers/promises'; async function doSomething() { console.log('doSomething started!'); await setTimeout(2000); console.log('Delayed Timers!'); } doSomething(); Web Crypto API Before Node version 16, external libraries were needed to be introduced to perform cryptographic activities which brought up issues on their effectiveness. Cryptographic tasks involve encryption and portrayal of all sorts, hashing, generation of signature, multifaceted authentication, and so on. Node 16 introduces worked-in help for such activities which makes it simple and productive to complete such tasks utilizing Node.js. Abort Controller Another interesting feature of Node version 16 is the AbortController. It is because before this the team could only unsubscribe to the API calls that they have already made but didn’t really abort them and they were still executed. However, With AbortController they can really cut short any sort of API demand: it tends to be a response body type or it can even be a transfer (like downloading a video). var controller = new AbortController(); var signal = controller.signal; var abortBtn = document.querySelector('.abort'); var downloadBtn = document.querySelector('.download'); downloadBtn.addEventListener('click', fetchVideo); abortBtn.addEventListener('click', function() { controller.abort(); console.log('Download aborted'); }); function fetchVideo() { ... fetch(url, {signal}).then(function(response) { ... }).catch(function(e) { reports.textContent = 'Download error: ' + e.message; }) } Buffer atob and btoa These techniques for changing over information into base64 encoded strings and back were added to help legacy web stage APIs. This isn’t the favored way, and should not be utilized in new code. The favored method to change over information into a base64 encoded string is to utilize the Buffer.from(data, 'base64') strategy or buf.toString('base64') to change the buffer into a ‘base64’ string. npm v7 Node 16 improvements incorporate the introduction of npm v7 with the LTS channel. npm went through considerable inner refactoring for performance improvement and upgrade the peer dependencies workflow. Peer dependencies are currently introduced automatically along with regular dependencies. This may be a breaking change in certain work processes. There’s additionally another arrangement for package-lock.json which empowers more solid deterministic builds. It currently incorporates all npm needs to revamp your package tree without any preparation. Async Local Storage APIs One of the primary territories to focus on helping the clients in distinguishing and dealing with the issues present in the production includes problem determination and perceptibility. Also, the idea of AsyncLocalStorage API ends up being a lot simpler, dependable, and fast to turn steady when contrasted with the major Async Hooks. While the AsyncLocalStorage API stable is as yet not found for the Node 16 release, it is surprising that the Node.js team is working really hard for this. Apple Silicon Another new feature of Node 16 is the distribution of builds for Apple Silicon processors. This ought to improve execution on new Mac hardware. Node.js will run natively on the Apple M1, rather than utilizing the Rosetta copying layer. Clients introducing by means of the tarball distribution mechanism should pick between darwin-x64 (Intel) or darwin-arm64 (Apple Silicon) bundles. Deprecations Being a major release, Node version 16 accompanies a few deprecations and removals. You can find more details in the complete changelog. A notable deprecation is the aim to eliminate access to several core modules through process.binding(). This call gives a component to get to the basic C++ objects behind the Javascript execution of modules. Bindings for modules including crypto, v8, async_wrap, and URL have been deprecated and could be taken out later on. Somewhere else, the recursive alternative to the fs.rmdir() directory removal function has also been deprecated. New code should utilize the option fs.rm(path, {recursive: true}) function instead. This change has been made to all the more likely adjust Node.js to the rmdir Unix order and rmdir()– equivalent functions in another programming. Conclusion Node 16 stable version is a significant new release that carries several new features to the LTS channel while rolling the most recent V8 JavaScript highlights. This comes close to npm v7 and the release of Apple Silicon-native builds. You can hire Nodejs developers if you plan to outsource web services using Nodejs. You can get the new release through the current channel by following the installation documents on the Node.js site. Node version 14 will be replaced by version 16 as the LTS release on October 26th, 2021. The current Node.js version 15 will stay upheld until June first, 2021. Clients should hope to move up to v16 as quickly as time permits. The currently active LTS branch, v14, will be kept up through the finish of April 2023. Get Latest News: https://www.geekstrick.com/news Share this:TwitterFacebookRedditLinkedInWhatsAppPrintTumblr Related