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


Flox Releases Flox Hub
13/03/2024

Flox has announced that its Command Line Interface (CLI) and FloxHub are now generally available. The CLI is open source and FloxHub is free for anyone to use.



Master Large Language Model Ops
20/03/2024

New technology brings with it more career opportunities. You may never have imagined becoming an LLMOps consultant,  but there's now a Coursera Specialization which provides preparation for this  [ ... ]


More News

raspberry pi books

 

Comments




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