
# What is nstd?

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

**nstd** is a small JavaScript runtime powered by
[QuickJS-NG](https://github.com/quickjs-ng/quickjs) and Node.js-compatible
standard library modules from [nstdlib](/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](https://github.com/quickjs-ng/quickjs)** 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](/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](https://github.com/nodejs/undici)
  for Fetch and web APIs, [ada](https://github.com/ada-url/ada) for URL parsing,
  [merve](https://github.com/nodejs/merve) for CommonJS analysis,
  [llhttp](https://github.com/nodejs/llhttp) for HTTP parsing, and
  [Mbed TLS](https://github.com/Mbed-TLS/mbedtls) 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](/guide/compatibility) for what's covered and what
isn't.

## At a glance

| Feature                 | Details                                 |
| ----------------------- | --------------------------------------- |
| Distribution            | one executable, nothing else to install |
| Requires Node.js to run | no                                      |
| JavaScript engine       | QuickJS-NG (interpreter, no JIT)        |
| Host language           | Zig                                     |
| Standard library        | nstdlib, 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](/guide/install) 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?](/nstdlib)
