Blessed JavaScript

Sometimes you need an npm package. This list of "blessed" JavaScript npm packages (and other tools) helps you quickly find the best one for common use cases.

📚 Check out sindresorhus/awesome-nodejs and sorrycc/awesome-javascript for more comprehensive lists.

General

Random numbers

crypto.getRandomValues() [docs]
Use to generate cryptographic random numbers. If you're not sure, use this.

Math.random() [docs]
Use to generate pseudo-random numbers

Time and date

Temporal API [docs]
The new comprehensive builtin time, date, and calendar API for JS. Not yet available in all environments.

temporal-polyfill [docs]
The best drop-in polyfill for the Temporal API. Use this until the native Temporal API is widely supported.

UUIDs

crypto.randomUUID() [docs]
Use this builtin if you only need to generate v4 UUIDs

uuid [docs]
Use this if you need to generate more than just v4 UUIDs or do more than just generate UUIDs

Temporary files

tempy [docs]
Most popular temporary file & directory package for Node.js

See also

Deno.makeTempFile() [docs]
Use the native Deno API instead of importing an npm package if you're using Deno

Compression & decompression

Compression Streams API [docs]
Use this builtin if it supports your format

node:zlib [docs]
Use this Node.js builtin if it supports your format as a second choice

Logging

TODO

Tooling

Desktop JavaScript runtimes

Node.js [docs]
The most popular desktop JavaScript runtime. If you're not sure, use this.

Deno [docs]
A comprehensive alternative JavaScript toolchain to Node.js & npm

Bun [docs]
A faster Node.js & npm alternative with more features

Toolchain management

nvm [docs]
Use this to manage Node.js versions for Linux & macOS. Officially recommended by https://nodejs.org/en/download.

fnm [docs]
Fast cross-platform Node.js manager. Officially recommended by https://nodejs.org/en/download.

See also

deno upgrade [docs]
Prefer always using the latest Deno version

bun upgrade [docs]
Prefer always using the latest Bun version

Code formatting

@biomejs/biome [docs]
The faster alternative to Prettier that also does linting. Use this in modern projects.

prettier [docs]
The most popular JavaScript code formatter

See also

deno fmt [docs]
Use the builtin Deno formatter if you're using Deno

Type checking

typescript [docs]
De-facto standard type checker for JavaScript

See also

deno check [docs]
Use Deno's TypeScript checking service if you're using Deno

Linting

@biomejs/biome [docs]
The faster linter that also does formatting. Use this if you don't need custom plugins.

eslint [docs]
The most popular JavaScript linter. Use this if you need to use plugins.

See also

deno lint [docs]
Deno's builtin linter toolkit. Supports plugins. Use this if you're using Deno.

Package managers

npm [docs]
The bundled package manager that comes with Node.js. Use this if you're undecided.

pnpm [docs]
Use this if you need its extra features like dependency patching

See also

deno add [docs]
Use the Deno package manager if you're using Deno

bun pm [docs]
Use the Bun package manager if you're using Bun

Testing

node:test [docs]
The included Node.js test toolkit. Use this if possible. May use node:assert for assertions. Also works with Deno and Bun.

vitest [docs]
Vite's accompanying testing tool. Use this if you're using Vite or need its extra features like browser testing.

See also

Deno.test() [docs]
Deno's builtin testing toolkit. Use this if you're using only Deno.

bun:test [docs]
Bun's builtin testing toolkit. Use this if you're using only Bun.

Math & science

Big decimal

TODO

Linear algebra

TODO

DataFrames

TODO

FFI & interop

C/C++ to JS

ffi-rs [docs]
Runtime dlopen() with types for Node.js and friends. Use this on existing .so/.dylib/.dll dynamic libraries.

Rust to JS

napi-rs [docs]
Use #[napi] annotations to expose Rust functions to JavaScript via the C Node-API.

wasm-bindgen [docs]
Use #[wasm_bindgen] annotations to expose Rust functions to JavaScript via WebAssembly

Networking

HTTP client

Fetch API [docs]
Node.js has fetch() builtin now. Use it.

HTTP server

hono [docs]
Rising standards-based web server framework

express [docs]
The most popular Node.js HTTP framework

WebSocket client

WebSocket [docs]
Basic WebSocket client available in Node.js & friends and browsers. Single event stream. Use this for basic tasks.

socket.io [docs]
Comprehensive popular WebSocket wrapper for servers and clients. Supports multiplexing. Use this if your server uses socket.io.

WebSocket server

socket.io [docs]
Comprehensive popular WebSocket wrapper for servers and clients. Supports multiplexing.

CLIs

Argument parsing

util.parseArgs() [docs]
Basic builtin argument parsing. Use this for local project scripts.

TODO

Globbing

fs.promises.glob() [docs]
Node.js now has builtin globbing support. Use this unless you need more features.

globby [docs]
Globber that deals with .gitignore too.

File watching

watcher [docs]
The most complete file & directory watcher.