
Node.js 22 Has Free Built-in APIs — Here's What Replaces Your npm Packages
Node.js 22 is the current LTS release — and it comes with powerful free built-in APIs that replace dozens of npm packages. What's New in Node 22? Node 22 shipped features that eliminate entire categories of dependencies: Built-in test runner — no more Jest/Vitest Native watch mode — no more nodemon --env-file — no more dotenv Glob support in node:fs — no more glob package WebSocket client — native, no ws package node --run — scripts without package.json The Free APIs You're Not Using 1. Built-in Test Runner (replaces Jest) import { describe , it } from " node:test " ; import assert from " node:assert/strict " ; describe ( " User API " , () => { it ( " creates a user " , async () => { const res = await fetch ( " http://localhost:3000/users " , { method : " POST " , headers : { " Content-Type " : " application/json " }, body : JSON . stringify ({ name : " Alex " }) }); assert . equal ( res . status , 201 ); const user = await res . json (); assert . equal ( user . name , " Alex " ); });
Continue reading on Dev.to Tutorial
Opens in a new tab



