Node.js 18 Adds Core Test Runner
Written by Ian Elliot   
Tuesday, 26 April 2022

Node.js 18 has been released with improvements including the enabling by default of global fetch, and a core test runner module.

Node.js is an open-source, cross-platform asynchronous event driven JavaScript runtime built on Chrome's JavaScript engine. It uses an event-driven, non-blocking I/O mode and executes JavaScript code outside web browsers.

nodejslogo

This release has an experimental global fetch API that is available by default. The addition gives Node.js a standardized interface for fetching resources over HTTP. The promise-based client can be used to send simplified HTTP requests, and was inspired by node-fetch.

Another addition is a node:test module that can be used to create JavaScript tests that report results in TAP (Test Anything Protocol) format. Tests created via the test module consist of a single function that is processed either as a synchronous function that is considered failing if it throws an exception; as a function that returns a Promise that is considered failing if the Promise rejects; or as a function that receives a callback function. If the callback receives any truthy value as its first argument, the test is considered failing.

Node.js now exposes the experimental implementation of the Web Streams API on the global scope 

The other main change to this release is the update of the V8 JavaScript engine to 10.1, which is part of Chromium 101. This brings with it several new features, including support for the findLast() and findLastIndex() array methods, and improved performance of class fields and private class methods so that initializing them is now as fast as ordinary property stores.

Node.js 18 is downloadable now.

nodejslogo

More Information

Node.js Foundation Homepage

Related Articles

Node.js 16 Adds Apple Silicon Support

Node.js 15 Improves Rejection Handling

Node.js 14 Adds New Diagnostic Tools

Getting Started with Node.js

Node.js Gets A Foundation - Is It Rock Solid?

To be informed about new articles on I Programmer, sign up for our weekly newsletter, subscribe to the RSS feed and follow us on Twitter, Facebook or Linkedin.

Banner


Google Introduces JPEG Coding Library
15/04/2024

Google has introduced Jpegli, an advanced JPEG coding library that maintains high backward compatibility while offering enhanced capabilities and a 35% compression ratio improvement at high quality co [ ... ]



JetBrains Launches IDE Services
09/04/2024

JetBrains has launched a new product suite for enterprises. JetBrains IDE Services is designed for use by large organizations with the aim of boosting developer productivity at scale.


More News

raspberry pi books

 

Comments




or email your comment to: comments@i-programmer.info