Install (once)
~/.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.jsonfield or environment variable that grants access. - Scopes are comma-split and repeatable:
--allow-read=src,views. - A bare flag grants the whole category:
--allow-netmeans 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-runand--allow-ffiare trust-equivalent to full access. Permissions catch mistakes; they are not an OS sandbox.
Run a file
Createhello.js:
There is no bundled
examples/ directory — always create the file first (or scaffold with ff init -y demo).Run inline code
Minimal server
Createserver.js:
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
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
Console
log, info, debug, warn, error, slops, redbal, detail. All return undefined.
Microtasks
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/donepattern - CLI —
init,start,imprint,test, and the rest