mirror of
https://github.com/oven-sh/bun
synced 2026-02-09 10:28:47 +00:00
3.5 KiB
3.5 KiB
Bun implements a set of native APIs on the Bun global object and through a number of built-in modules. These APIs are heavily optimized and represent the canonical "Bun-native" way to implement some common functionality.
Bun strives to implement standard Web APIs wherever possible. Bun introduces new APIs primarily for server-side tasks where no standard exists, such as file I/O and starting an HTTP server. In these cases, Bun's approach still builds atop standard APIs like Blob, URL, and Request.
Bun.serve({
fetch(req: Request) {
return new Response("Success!");
},
});
Click the link in the right column to jump to the associated documentation.
{% table %}
- Topic
- APIs
- HTTP server
Bun.serve
- Bundler
Bun.build
- Child processes
Bun.spawnBun.spawnSync
- Transpiler
Bun.Transpiler
- Routing
Bun.FileSystemRouter
- Streaming HTML Transformations
HTMLRewriter
- Hashing
Bun.hashBun.CryptoHasher
- import.meta
import.meta
- SQLite
bun:sqlite
- FFI
bun:ffi
- Testing
bun:test
- Node-API
Node-API
- Glob
Bun.Glob
- Utilities
Bun.versionBun.revisionBun.envBun.mainBun.sleep()Bun.sleepSync()Bun.which()Bun.peek()Bun.openInEditor()Bun.deepEquals()Bun.escapeHTML()Bun.fileURLToPath()Bun.pathToFileURL()Bun.gzipSync()Bun.gunzipSync()Bun.deflateSync()Bun.inflateSync()Bun.inspect()Bun.nanoseconds()Bun.readableStreamTo*()Bun.resolveSync()
{% /table %}