![]() In addition, they are now available globally. Both Blob and BroadcastChannel are no longer experimental. There are some other APIs that received significant attention in the latest Node.js release. With Node.js 18, the experimental implementation of Web Stream is exposed to the global scope, making all the various stream interfaces globally accessible. The Web Streams API includes a number of stream interfaces that work alone or in concert to process various types of resources. The technique has its benefits in terms of both performance and user experience on the web. This API is all about streaming - that is - breaking a resource into small chunks and processing it little by little. The new feature will certainly make the Node index more powerful. With that change, the browser globals fetch, FormData, Headers, Request, and Response are now available in Node.js. The implementation tries to be as specification-compliant as possible, making the native browser fetch API compatible with NodeJS. The new implementation comes from undici and is inspired by node-fetch. Node 18 features an experimental global fetch API, which enables the same methods without having to rely on external packages. Now, using it will become even more efficient. The node-fetch module has always been very helpful as an easy way to fetch data to and from external web servers or APIs. New globally available browser-compatible APIs Fetch API Let’s start with version 18, which as of Mais still the active LTS version. Versions 16-18 brought a lot of interesting developments. Hopefully, this change will make the Web Crypto API more popular than it has been so far within the Node.js community. Their lack of access to hardware features and multi-threading was a major issue as well. The third-party high-level JavaScript cryptographic libraries are a frequent target of complaints regarding their efficiency and security. ![]() This is definitely good news for security-oriented Node.js users. The globalThis.crypto class accesses the module that provides a variety of low-level cryptographic functions. Node.js 19 brings a stable version of the WebCrypto API. Should the feature become stable, it will definitely improve throughput as all the available connections will now be reused by default. Any outgoing HTTP(S) connection will use it. Starting with Node.js 19, it’s going to be true by default. The Keep-Alive instruction allows a single TCP connection to stay open for a multitude of HTTP requests. It allows for getting rid of external dependencies to live-reload. The new –watch flag is something that the Node.js community has been talking about and advocating for years. Most Node.js developers got used to installing dev dependencies that allowed them to auto-restart the server when any changes in the code appeared. The Software House’s senior Node.js developer Rafał Gołubowicz is very fond of this addition: You can turn it on with the following command: The newly supported watch mode restarts a process at a time when a change occurs to an imported file. Still, it offers some very interesting new features. Node.js 19 was only released back in October 2022, but as an odd-numbered version it is already on the verge of becoming unsupported. Node.js 18 is now the Current version and is expected to become the new Active LTS version this October. The odd-numbered version 17 has just lost its Current status and its end-of-life is coming this June. Node.js 16 is now the Active LTS version. What about the status of the latest Node.js releases? It will continue to receive updates until its end-of-life date. Once a new one shows up and completes the Current status, the previous one moves to the Maintenance LTS. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |