What’s New in Node.js 18? Fetch API, Test Runner, V8 Upgrade & More

Node.js 18 introduces built‑in fetch and test modules, modernizes the standard library, adds a native test runner, upgrades the V8 engine, and outlines future roadmap items such as modern HTTP, improved type support, and enhanced ESM capabilities, all while offering quick installation via version managers.

Alipay Experience Technology
Alipay Experience Technology
Alipay Experience Technology
What’s New in Node.js 18? Fetch API, Test Runner, V8 Upgrade & More

Overview

Node.js 18.0.0 introduces built‑in standard modules such as fetch and node:test. The standard library is becoming more standardized while user libraries become more refined.

Quick Experience

Use a version manager like fnm, nvs or nvm to install and run Node 18. Example:

$ fnm install 18
Installing Node v18.0.0 (arm64)

$ fnm use 18
Using Node v18.0.0

$ node -v
v18.0.0

Note: this version is not LTS; it becomes LTS on 2022‑10‑25.

Future Roadmap (Next‑10)

The Node.js project’s “Next 10” effort focuses on modern HTTP, friendly type support, progressive documentation for beginners, ECMAScript compliance, observability (logging/metrics/tracing/APM), better multithreading, single‑file distribution, and more.

Fetch API

In browsers fetch() replaces XMLHttpRequest. Node.js now provides a native fetch implementation based on the undici library, following the Fetch specification.

const res = await fetch('https://nodejs.org/api/documentation.json');
if (res.ok) {
  const data = await res.json();
  console.log(data);
}

The new global APIs include fetch, FormData, Headers, Request, Response and the Web Streams API. They are currently experimental and documented under the “Globals” section.

Test Runner

Node.js 18 adds a built‑in test runner ( node:test) that mirrors the API of popular frameworks like Mocha and Jest. Example:

import test from 'node:test';
import assert from 'assert/strict';

test('asynchronous passing test', async () => {
  const res = await fetch('https://nodejs.org/api/documentation.json');
  assert(res.ok);
});

The runner supports test() with skip, only, and concurrency options, but lacks before/after hooks and built‑in reporters.

Build‑time User‑land Snapshot

Node.js can compile a JavaScript file into a V8 snapshot to speed up startup. Currently this requires building Node from source, but future work aims to enable snapshot creation without recompiling the runtime.

# Build a snapshot from a markdown renderer
$ cd /path/to/node/source
$ ./configure --node-snapshot-main=marked.js
$ make node

$ out/Release/node
> const html = globalThis.marked('# this is title');

V8 Engine Upgrade

Node.js 18 ships with V8 10.1, bringing class fields and private method performance optimizations, improved Intl support for localization, and new array methods such as findLast and findLastIndex.

ESM Support

Continued work on ECMAScript modules adds JSON import assertions, native JSON module support, and experimental HTTPS/HTTP imports. The loader team is also developing a new ESM loader.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Backend DevelopmentNode.jsV8ESMfetch APITest Runner
Alipay Experience Technology
Written by

Alipay Experience Technology

Exploring ultimate user experience and best engineering practices

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.