What is nstd?

A tiny, standalone JavaScript runtime with no Node.js installation required.

nstd is a small JavaScript runtime powered by QuickJS-NG and Node.js-compatible standard library modules from nstdlib. Its JIT-less engine also suits restricted environments such as iOS, where runtime code generation is unavailable. It builds to a ~5 MB native executable or a ~4.6 MB WebAssembly module for WASI, with a browser target planned. Point it at a script and it runs much like node script.js.

#Why you'd use it

  • No Node.js installation required. You ship one file, and that file is the whole runtime.
  • It starts fast. The standard library is compiled into the binary as bytecode instead of source text, so there is nothing to parse on the way to your first line of code.
  • It's small. The native executable is ~5 MB, including the engine and standard library; the WASI WebAssembly module is ~4.6 MB.

If you're building a small CLI tool, embedding a scripting layer in another program, or just curious how far a from-scratch Node-compatible runtime can get, this is what to try first.

#How it works

  • QuickJS-NG is the JavaScript engine. It's an interpreter with no JIT, so it favors low memory and fast startup over raw execution speed.
  • A Zig host talks to the operating system: reading and writing files, opening sockets, watching for file changes, running TLS connections. This is the part that has no equivalent inside a browser or inside plain nstdlib. It's what turns "a library that could work anywhere" into "a runtime that works here."
  • nstdlib, compiled into the binary as bytecode, provides fs, http, path, events, and the rest of the Node.js standard library.
  • Bundled dependencies include Undici for Fetch and web APIs, ada for URL parsing, merve for CommonJS analysis, llhttp for HTTP parsing, and Mbed TLS for secure connections.

#How it's different from Node.js

nstd is not Node with a different launcher. Under the hood almost nothing is shared:

  • It runs on QuickJS-NG, not V8.
  • Its networking and event loop are a small Zig host built on poll(2), not libuv.
  • TLS is mbedTLS, not OpenSSL.
  • Its URL parser and CommonJS lexer are the same C/C++ code Node itself vendors, compiled directly into the binary, so those two pieces match Node exactly.

Because none of that is shared with Node, compatibility is something this project measures rather than assumes. Large parts of the standard library work as expected. Some things don't yet: for example, there is no TLS server, and a few CLI options Node accepts are refused here. See Node.js Compatibility for what's covered and what isn't.

#At a glance

FeatureDetails
Distributionone executable, nothing else to install
Requires Node.js to runno
JavaScript engineQuickJS-NG (interpreter, no JIT)
Host languageZig
Standard librarynstdlib, compiled in as bytecode

#Status

nstd is experimental. It is not a finished, general-purpose replacement for Node. Treat it as a project in active progress: a real and growing amount of Node's behavior works correctly, and the gaps are tracked and documented rather than silently ignored.

#Next

  • Installation covers building nstd from source, which is the only way to get it today.
  • If you want the standard library itself, to use inside Node, a bundler, a worker, or a browser, rather than this standalone binary, see What is nstdlib?