Skip to main content
Get the binary, run a script, start a server, open a database. Native APIs are deny-by-default, so the server and database commands carry the flags they need.

Install (once)

Prebuilt for macOS (Apple silicon / Intel) and Linux (x86_64 / ARM64), SHA-256 verified, installs to ~/.local/bin/ff. Docker and source builds: Installation.

Permissions

ff hello.js needs no flags: it touches only core JS. Anything native needs a grant on the launch command:
  • Flags are CLI-only. There is no ff.json field or environment variable that grants access.
  • Scopes are comma-split and repeatable: --allow-read=src,views.
  • A bare flag grants the whole category: --allow-net means any host and port.
  • Missing access throws PermissionDenied (code: "PERMISSION_DENIED") before I/O starts. FFI uses the same shape without a scope suffix: ffi.dlopen requires --allow-ffi.
  • --allow-run and --allow-ffi are trust-equivalent to full access. Permissions catch mistakes; they are not an OS sandbox.
Full model: Permissions.

Run a file

Create hello.js:
Run it:
There is no bundled examples/ directory — always create the file first (or scaffold with ff init -y demo).

Run inline code

Minimal server

Create server.js:
Run it with the listener scope:
Test it in another terminal:
The listener always binds 0.0.0.0, so the scope must name 0.0.0.0:3000; --allow-net=127.0.0.1:3000 does not match. http.serve accepts two call shapes: http.serve(3000, handler) and http.serve({ port: 3000 }, handler). The one-argument http.serve(handler) form is not supported — it throws TypeError: http.serve requires (options, handler). The handler receives (url, method, body) strings and returns a Response (or a { status, body } object, as above). Full contract: HTTP Server guide.

SQLite

SQLite opens the database read/write and creates app.db-wal and app.db-shm beside it, so the parent directory needs --allow-write. :memory: is exempt from all path checks. No packages to install. SQLite is built into the runtime — full reference: SQLite API.

Timers

Max 128 live timers. Full guide: Timers.

Console

Methods: log, info, debug, warn, error, slops, redbal, detail. All return undefined.

Microtasks

Output:
No process.nextTick. Use queueMicrotask.

Next steps

  • Permissions — deny-by-default rules, scopes, denial contract
  • Examples — runnable snippets with their flags
  • HTTP Server guide — routing, JSON APIs, TLS
  • Testing — the check/done pattern
  • CLI — init, start, imprint, test, and the rest