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


Eclipse IoT Developer Survey 2024
04/12/2024

The Eclipse Foundation’s IoT Working Group has released the results of its 2024 IoT Developer Survey. Industrial automation and automotive are now the leading industry sectors and connectivity is th [ ... ]



The Advent of SQL 2024 Has Commenced
11/12/2024

It's Advent - the time of year when we countdown the days to Christmas - and if your are a programmer complete daily coding challenges with the Advent of Code, the Advent of Perl, the Advent of Java,  [ ... ]


More News

espbook

 

Comments




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