Node.js Compatibility
Pure implements the most common Node.js built-in modules. The goal is drop-in compatibility for the vast majority of npm packages. This page lists what is available, what is partial, and what is absent.
Module support summary
Section titled “Module support summary”| Module | Status | Notes |
|---|---|---|
node:fs / fs | ✅ Full | Sync and async, streams, watchers |
node:path | ✅ Full | |
node:os | ✅ Full | |
node:crypto | ✅ Full | Including crypto.subtle |
node:buffer | ✅ Full | Buffer.from, Buffer.alloc, etc. |
node:stream | ✅ Full | Readable, Writable, Transform, PassThrough, pipeline |
node:stream/promises | ✅ Full | |
node:events | ✅ Full | EventEmitter |
node:net | ✅ Full | TCP sockets, server, createConnection |
node:http | ✅ Full | http.createServer, http.request, http.get |
node:https | ✅ Full | |
node:http2 | ⚠️ Partial | Client support only; server push not implemented |
node:url | ✅ Full | |
node:querystring | ✅ Full | |
node:zlib | ✅ Full | gzip, deflate, brotli |
node:util | ✅ Full | promisify, inspect, format, inherits, etc. |
node:assert | ✅ Full | |
node:child_process | ✅ Full | spawn, exec, execFile, spawnSync, execSync |
node:process | ✅ Full | env, argv, exit, cwd, pid, signals, stdin/stdout/stderr |
node:worker_threads | ✅ Full | Worker, workerData, parentPort, MessageChannel |
node:timers | ✅ Full | |
node:timers/promises | ✅ Full | |
node:readline | ✅ Full | |
node:string_decoder | ✅ Full | |
node:perf_hooks | ✅ Full | performance.now(), PerformanceObserver |
node:diagnostics_channel | ✅ Full | |
node:async_hooks | ⚠️ Partial | AsyncLocalStorage supported; AsyncResource partial |
node:inspector | ❌ Not supported | |
node:vm | ❌ Not supported | See Not supported |
node:repl | ❌ Not supported | |
node:v8 | ⚠️ Partial | serialize/deserialize supported; heap profiling not available |
node:wasi | ❌ Not supported | |
node:sqlite | ❌ Not supported | Use better-sqlite3 or @electric-sql/pglite |
node:domain | ❌ Not supported | Deprecated upstream |
Notable caveats
Section titled “Notable caveats”fs.watch and fs.watchFile
Section titled “fs.watch and fs.watchFile”File watchers work on Linux and macOS. On macOS, fs.watch uses FSEvents. Watch events on paths inside a VFS directory are not supported (VFS is read-only and does not change at runtime).
child_process
Section titled “child_process”fork() is not supported. Use spawn or exec. The shell: true option on spawn is supported.
node:http and node:https
Section titled “node:http and node:https”The HTTP server is fully functional. The Agent class (keep-alive connection pooling) is supported. http.globalAgent and custom agents work as expected.
node:async_hooks / AsyncLocalStorage
Section titled “node:async_hooks / AsyncLocalStorage”AsyncLocalStorage is the recommended API and is fully supported. AsyncResource is partially supported — runInAsyncScope works, but manual trigger tracking via AsyncResource.bind has edge cases with some callback patterns.
process.stdin in non-TTY mode
Section titled “process.stdin in non-TTY mode”process.stdin works as a readable stream when piped. Interactive TTY mode (raw mode) is supported via readline.
process.execPath
Section titled “process.execPath”Returns the path to the compiled binary, not a node or bun executable. Code that does child_process.spawn(process.execPath, ...) to start a sub-process works as expected — it spawns another instance of the same binary.
Bun compatibility
Section titled “Bun compatibility”See the Bun-specific notes in Not supported for Bun APIs that do not apply to Pure binaries.