Node.js 21 Released with V8 Update and New Features
- The fetch and WebStreams modules have gained stable status after a recent update. This affects WebStreams, FormData, Headers, Request, Response, and fetch modules, making it important for developers to take note.
- An experimental WebSocket implementation has been added, which can be activated using the –experimental-websocket flag.
- During test execution, glob expressions can now be used in parameters with the –test flag. This enables more flexible and convenient test execution. For example, you can run all .test.js files in multiple project directories using the command
node --test **/*.test.js.
- An experimental flag, –experimental-default-type, has been introduced, allowing you to change the default module system. It’s important to note that ES and CommonJS modules with explicit types remain unaffected. Only CommonJS modules with implicit definitions will be interpreted as ES by default under this flag.
- By passing the –experimental-wasm-modules flag, files without extensions will be treated as WebAssembly if they start with \0asm.
- Support for globalPreload has been removed, with a recommendation to use initialize for setting up communication between threads and register for sending data from the application thread.
- Sometimes, data written to a file may remain available for subsequent operations for a period. In this release, a flush option has been added to the fs.writeFile family of functions, which forcibly clears files.
- Optimization has been carried out on Writable and Readable streams by removing redundant checks and improving the callback scheduling system.
- I'm Martin Harris, a tech writer with extensive experience, contributing to global publications. Trained in Computer Science, I merged my technical know-how with writing, becoming a technology journalist. I've covered diverse topics like AI and consumer electronics, contributing to top tech platforms. I participate in tech events for knowledge updating. Besides writing, I enjoy reading, photography, and aim to clarify technology's complexities to readers.
- Unusual04/11/2023Japanese Scientists Develop Durable, Self-Healing, Biodegradable Plastic
- Blockchain03/11/2023Telegram’s TON Becomes World’s Fastest Blockchain, Outpaces Visa and MasterCard
- Internet27/10/2023Google Search Now Provides Source Data for Images
- Business26/10/2023Honor Leads Chinese Smartphone Market as vivo Falters, Apple Reclaims Top Three