Skip to main content
fairyflyis a JavaScript runtime built for instant scale-to-zero and high-density cloud.

Built for cold starts, tight memory, and short-lived handlers. One binary with HTTP, TLS, HTTP/2, WebSocket, fetch, SQLite, Postgres, workers, and FFI.

Fairyfly logo
Install
165kreq/sec
~10 mscold start
2.9 msp50
1binary

Built for serverless

Fast cold starts, roughly 5 MB RSS on Apple silicon, and one binary. No npm install for the core.

One binary, batteries included

HTTP, TLS, HTTP/2, WebSocket, fetch, SQLite, Postgres, workers, crypto, and FFI ship in the same binary.

Small enough to audit

About 32k lines of Zig across 73 files. The whole runtime fits in your head.

ESM without the baggage

Pure-JS ESM packages via ff imprint, one flat node_modules, and a lockfile with integrity hashes.

Predictable limits

Every hard cap is documented — connections, bodies, timers, workers, and fetch slots.

Deploy anywhere

Prebuilt binaries, containers, and bytecode for serverless, edge, and long-lived deployments.

Built for the shape of serverless.

Serverless first — Fairyfly is designed first for short-lived, memory-constrained workloads: fast cold starts, one binary, no npm install for the core, and a process that exits when the event loop drains.
  • Start fast: one binary with no runtime dependency tree.
  • Stay small: roughly 5 MB RSS for a hello-world server on Apple silicon.
  • Exit cleanly: no referenced work means the process stops.
Serverless deployment guide → · Read the design deep dive →
handler.js
Fairyfly is a native POSIX binary: it fits container-based serverless platforms and edge VMs, not V8-isolate runtimes such as Cloudflare Workers.

Serve, call, and store — with zero setup.

Quick start — No package.json, no node_modules, no build step for the core. The server, client, and database are already in the binary.
  • Start an HTTP server with http.serve.
  • Call any API with the built-in fetch.
  • Persist data with embedded SQLite through Database.open.
Read the quickstart →
server.js

Everything you need is already in the binary.

Batteries included — HTTP, WebSocket, fetch, SQLite, Postgres, workers, crypto, and FFI. No dependency tree to install or audit.

HTTP server

HTTP/1.1, TLS, HTTP/2, and automatic WebSocket upgrades.

fetch

16 concurrent HTTP/1.1 slots, AbortSignal, redirects, proxies, and a 30 s timeout.

WebSocket

Server upgrades and a client with text and binary frames.

SQLite

Embedded, synchronous Database.open() with transactions.

Postgres

Tagged-template sql queries, TLS verify-full, and a 10-connection pool.

Workers

Up to 8 OS threads with structured-clone messaging.

Crypto

UUIDs, random values, SHA digests, HMAC, bcrypt, and base64 helpers.

FFI

Call C-ABI shared libraries with —allow-ffi.

Small enough to read. Fast enough to ship.

Architecture — About 32k lines of Zig across 73 files. One event loop, no hidden request threads, and a hot path designed for the common case.
  • 512-slot SoA connection table with packed 2-byte flags.
  • 64 KB static response staging per slot, spilling to the heap at 10 MB.
  • libxev event loop: io_uring on Linux, kqueue on macOS, epoll fallback.
  1. JavaScript source
  2. QuickJS parser + bytecode
  3. Zig API layer
  4. libxev · io_uring / epoll / kqueue
How it works →

One binary for the whole workflow.

CLI — Scaffold, run, test, and ship with the same ff binary. No separate task runner or build tool.

ff init

Write ff.json and an entry file in one command.ff init -y my-app

ff start

Run the project’s main, with optional TLS cert and key.ff start --allow-net=0.0.0.0:3000

ff test

Run test/*.test.js through the runtime.ff test

ff compile

Ship bytecode with source and debug info stripped.ff compile app.js -o app.ffbc
Full CLI reference →

Ship it anywhere.

Deploy — Ship a prebuilt binary, a container, or bytecode with the source stripped.

Prebuilt binary

macOS and Linux, installed to ~/.local/bin/ff with a SHA-256 check.curl -fsSL https://www.fairyfly.dev/install.sh | sh

Docker

A container image with the runtime and tools ready to run.docker run --rm ghcr.io/abdelmajidouhamane/ff:latest ff --version

Bytecode

Compile to .ffbc with source and debug info stripped.ff compile app.js -o app.ffbc
Deployment guide → · Installation →

Install packages without the baggage.

ES modules — ff imprint installs pure-JS ESM packages, writes a lockfile with integrity hashes, and keeps one flat node_modules.
  • No CommonJS, require(), or node: imports.
  • One flat node_modules — conflicting versions fail loudly.
  • Direct GitHub, Codeberg, and tarball sources with integrity pins.
Package guide →
terminal

Start with one binary. Stay small.

Get started — Install Fairyfly, run a server, and measure the memory yourself.
Quickstart · GitHub