Discover Bun's JavaScriptCore engine, Bun.serve(), bun:sqlite, bun:ffi, and why bun install outpaces npm.
0 / 5 completed
1 / 5
What is Bun and what runtime does it use internally?
Bun is written in Zig and uses JavaScriptCore (JSC) instead of V8. JSC's faster startup time makes Bun particularly quick for short-lived scripts and serverless workloads. Bun implements the Node.js API surface, so most Node.js code runs without modification.
2 / 5
What does Bun.serve() provide?
Bun.serve:Bun.serve({ port: 3000, fetch(req) { return new Response("Hello"); } }) uses the Fetch API Request/Response model. Bun benchmarks significantly faster than Node.js for raw HTTP throughput due to native I/O and JSC optimisations.
3 / 5
What is bun:sqlite?
bun:sqlite:import { Database } from "bun:sqlite" gives you a fast SQLite interface. Queries are synchronous but internally non-blocking via Bun's native bindings. This is useful for CLI tools, test fixtures, and embedded databases without any external dependency.
4 / 5
What is bun:ffi used for?
bun:ffi (Foreign Function Interface): you declare C function signatures with dlopen and call native code directly. Bun generates JIT-compiled trampolines for the calls, making FFI much faster than Node.js's node-ffi-napi which goes through N-API and requires compilation.
5 / 5
How does bun install differ from npm install in speed?
bun install: Bun stores packages in a global content-addressable cache and hard-links them into node_modules. It reads the bun.lockb binary lockfile (faster to parse than package-lock.json) and downloads packages in parallel, dramatically reducing install times especially on CI.