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


Microsoft Introduces Vector Abstractions Library For .NET
21/11/2024

Microsoft has announced a preview release of the Microsoft Extensions VectorData Abstractions library, which can be used to help integrate vector stores into .NET applications and libraries.



Apollo Adds REST APIs For GraphQL
29/10/2024

Apollo has added a simpler way to integrate REST APIs into a federated GraphQL environment. Available now in public preview, can be used to map REST API endpoints to their GraphQL schema using a decla [ ... ]


More News

espbook

 

Comments




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