Elide for Node users

What works unchanged, which commands change, and how Elide compares with Node.js.

Elide runs Node programs, node:* modules and npm packages; this page lists what changes when you switch.

Run the same code

elide app.js                    # or: elide run app.js
elide app.ts                    # no compile step, no tsconfig.json
elide install --ecosystems=npm  # dependencies from package.json
elide test                      # node:test files
  • node:fs, node:http, node:worker_threads and most other built-ins load with or without the node: prefix.
  • CommonJS and ES modules both work.
  • Tests written with node:test and node:assert run under elide test.
  • http.createServer serves as in Node. A module that default-exports a fetch handler, or calls Elide.serve({ fetch }), also serves.

Start with JavaScript and TypeScript. Module status is in the API Overview; suite results are in the Compatibility Matrix.

What changes

NodeElide
node app.jselide app.js
npm installelide install --ecosystems=npm; plain elide install skips npm
package-lock.jsonaube-lock.yaml
npm run buildelide run build
npx toolelide run tool for a tool in node_modules/.bin; no download-and-run
node --testelide test
node --inspect app.jselide run --debugger=cdp app.js
node --watch app.jsNo equivalent
node --env-file=.env app.jsCall process.loadEnvFile() in code
node --permission --allow-fs-read=.elide --allow-read=. app.js; see Sandbox and Limits
node:worker_threadsSame module; new Worker honors only workerData, eval, transferList and env
node:sqlite DatabaseSyncDatabase from elide:sqlite; see Database modules

Elide does not set NODE_ENV.

Benchmarks

Startup: hyperfine -N -w 10 on a 24-core Linux workstation, running a hello-world script.

RuntimeCommandMean
Nodenode hello.js11.4 ± 0.8 ms
Elideelide run hello.js2.1 ± 0.1 ms
Bunbun hello.js1.8 ± 0.2 ms
Denodeno run hello.js6.1 ± 0.3 ms

Bun starts faster than Elide.

Serving: wrk -t12 -c256 -d10s against a hello-world server. Each server ran on the same 24 CPUs and wrk on 24 others.

RuntimeRequests/sMean latency
Node91,4643.22 ms
Elide600,352419 µs
Bun147,7421.70 ms
Deno280,6660.89 ms

Every server ran with its defaults: Node, Bun and Deno serve on one thread, Elide on several. This compares defaults, not tuned deployments.

Strengths

  • Starts a hello-world script in 2.1 ms against Node’s 11.4 ms.
  • Runs .ts, .mts and .cts files directly, with no build step or tsconfig.json.
  • Served 600,352 requests per second against Node’s 91,464, both with default settings.
  • Scopes network access by host and subprocesses by command: --allow-net=api.example.com, --allow-run=git.
  • Limits workers, open files, heap and run time: --limit=workers=4, --limit=fds=128, --max-mem=512m, --timeout=30s.
  • Includes SQLite, PostgreSQL and MySQL drivers as elide:sqlite, elide:postgres and elide:mysql.

Weaknesses

  • Node-API compatibility is 86.8% and WinterTC 95.9% on their test suites.
  • node:http2, node:cluster, node:inspector and node:wasi throw ERR_UNKNOWN_BUILTIN_MODULE.
  • https.createServer throws ERR_HTTPS_SERVER_UNSUPPORTED; terminate TLS in front of http.createServer.
  • No download-and-run like npx, no --watch or --env-file, and no WebSocket global.
  • No bundler: elide web build transforms each file and keeps its imports.
  • No macOS Intel build; macOS releases are Apple Silicon only.

Next steps