1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
|
export type Nav = {
items: NavItem[];
};
export type NavItem = NavPage | NavDivider;
export type NavPage = {
type: "page";
slug: string;
title: string;
disabled?: boolean;
href?: string;
};
type NavDivider = {
type: "divider";
title: string;
};
function page(slug: string, title: string, props: { disabled?: boolean; href?: string; description: string }): NavPage {
return { type: "page", slug, title, ...props };
}
function divider(title: string): NavDivider {
return { type: "divider", title };
}
export default {
items: [
divider("Intro"),
page("index", "What is Bun?", {
description:
"Bun is an all-in-one runtime for JavaScript and TypeScript apps. Run, bundle, and test apps with one fast tool.",
}),
page("installation", "Installation", {
description: "Install Bun with npm, Homebrew, Docker, or the official install script.",
}),
page("quickstart", "Quickstart", {
description: "Get started with Bun by building and running a simple HTTP server in 6 lines of TypeScript.",
}),
page("templates", "Templates", {
description: "Hit the ground running with one of Bun's official templates, or download a template from GitHub.",
}),
// page("typescript", "TypeScript"),
// divider("CLI"),
// page("cli/run", "`bun run`", {
// description:
// "Use `bun run` to execute JavaScript/TypeScript files, package.json scripts, and executable packages.",
// }),
// page("cli/install", "`bun install`", {
// description: "A 100x faster npm client with workspaces, git dependencies, and private registry support.",
// }),
// page("cli/test", "`bun test`", {
// description: "Bun's test runner uses Jest-compatible syntax but runs 100x faster.",
// }),
// page("cli/create", "`bun create`", {
// description: "Scaffold a new Bun project from an official template or GitHub repo.",
// }),
// page("cli/bunx", "`bunx`", {
// description:
// "Use `bunx` to auto-install and run executable packages from npm, or use locally installed command-line tools.",
// }),
// page("cli/deploy", "`bun deploy`", {
// disabled: true,
// description: "Deploy your Bun app to the cloud (eventually)",
// }),
// page("bundler", "Bundler"),
// page("cli/bun-install", "`bun install`"),
// page("cli/bun-create", "`bun create`"),
// page("cli/bun-upgrade", "`bun upgrade`"),
// page("cli/bun-bun", "`bun bun`"),
// page("cli/bun-init", "`bun init`"),
// page("cli/bun-completions", "`bun completions`"),
// page("bundev", "Dev server"),
// page("benchmarks", "Benchmarks"),
// divider("Runtime"),
divider("Runtime"),
page("cli/run", "`bun run`", {
description: "Use `bun run` to execute JavaScript/TypeScript files and package.json scripts.",
}),
// page("runtime/index", "Overview", {
// description: `Bun is a new JavaScript runtime designed to be a faster, leaner, more modern replacement for Node.js.`,
// }),
// page("runtime/performance", "Performance", {
// description: `Bun is a new JavaScript runtime designed to be a faster, leaner, more modern replacement for Node.js.`,
// }),
page("runtime/loaders", "File types", {
description: `Bun's runtime supports JavaScript/TypeScript files, JSX syntax, Wasm, JSON/TOML imports, and more.`,
}),
page("runtime/typescript", "TypeScript", {
description: `Bun can directly execute TypeScript files without additional configuration.`,
}),
page("runtime/jsx", "JSX", {
description: `Bun can directly execute TypeScript files without additional configuration.`,
}),
// page("runtime/apis", "APIs", {
// description: `Bun is a new JavaScript runtime designed to be a faster, leaner, more modern replacement for Node.js.`,
// }),
page("runtime/bun-apis", "Bun APIs", {
description: `Bun provides a set of highly optimized native APIs for performing common tasks.`,
}),
page("runtime/web-apis", "Web APIs", {
description: `Bun implements an array of Web-standard APIs like fetch, URL, and WebSocket.`,
}),
page("runtime/nodejs-apis", "Node.js compatibility", {
description: `Bun aims for full Node.js compatibility. This page tracks the current compatibility status.`,
}),
// page("runtime/nodejs", "Node.js compatibility", {
// description: `Track the status of Bun's API compatibility with Node.js.`,
// }),
// page("runtime/web-apis", "Web APIs"),
// page("runtime/loaders", "Loaders"),
page("runtime/hot", "Watch mode", {
description: `Reload your application & tests automatically.`,
}),
page("runtime/modules", "Module resolution", {
description: `Bun uses ESM and implements an extended version of the Node.js module resolution algorithm.`,
}),
page("runtime/autoimport", "Auto-install", {
description: `Never use node_modules again. Bun can optionally auto-install your dependencies on the fly.`,
}),
page("runtime/configuration", "Configuration", {
description: `Bun's runtime is configurable with environment variables and the bunfig.toml config file.`,
}),
page("runtime/framework", "Framework API", {
disabled: true,
description:
"Coming soon. Use the Framework API to build a fast, cloud-ready framework on top of Bun's bundler and runtime.",
}),
divider("Package manager"),
page("cli/install", "`bun install`", {
description:
"Install all dependencies with `bun install`, or manage dependencies with `bun add` and `bun remove`.",
}),
page("install/workspaces", "Workspaces", {
description: "Bun's package manager supports workspaces and mono-repo development workflows.",
}),
page("install/cache", "Global cache", {
description:
"Bun's package manager installs all packages into a shared global cache to avoid redundant re-downloads.",
}),
page("install/lockfile", "Lockfile", {
description:
"Bun's binary lockfile `bun.lockb` tracks your resolved dependency ytrr, making future installs fast and repeatable.",
}),
page("install/registries", "Scopes and registries", {
description: "How to configure private scopes and custom package registries.",
}),
page("install/utilities", "Utilities", {
description: "Use `bun pm` to introspect your global module cache or project dependency tree.",
}),
divider("Bundler"),
page("bundler", "`Bun.build`", {
description: "Bundle code for comsumption in the browser with Bun's native bundler.",
}),
// page("bundler/intro", "How bundlers work", {
// description: "A visual introduction to bundling",
// }),
page("bundler/loaders", "Loaders", {
description: "Bun's built-in loaders for the bundler and runtime",
}),
page("bundler/plugins", "Plugins", {
description: `Implement custom loaders and module resolution logic with Bun's plugin system.`,
}),
page("bundler/executables", "Executables", {
description: "Compile a TypeScript or JavaScript file to a standalone cross-platform executable",
}),
page("bundler/macros", "Macros", {
description: `Run JavaScript functions at bundle-time and inline the results into your bundle`,
}),
page("bundler/vs-esbuild", "vs esbuild", {
description: `Guides for migrating from other bundlers to Bun.`,
}),
divider("Test runner"),
page("cli/test", "`bun test`", {
description: "Bun's test runner uses Jest-compatible syntax but runs 100x faster.",
}),
page("test/writing", "Writing tests", {
description:
"Write your tests using Jest-like expect matchers, plus setup/teardown hooks, snapshot testing, and more",
}),
page("test/lifecycle", "Lifecycle hooks", {
description: "Add lifecycle hooks to your tests that run before/after each test or test run",
}),
page("test/snapshots", "Snapshots", {
description: "Add lifecycle hooks to your tests that run before/after each test or test run",
}),
page("test/hot", "Watch mode", {
description: "Reload your tests automatically on change.",
}),
divider("Package runner"),
page("cli/bunx", "`bunx`", {
description: "Use `bunx` to auto-install and run executable packages from npm.",
}),
// page("runtime/nodejs", "Node.js APIs"),
divider("Ecosystem"),
// page("ecosystem/react", "React", {
// description: `The Bun runtime supports JSX syntax out of the box and optimizes server-side rendering.`,
// }),
page("ecosystem/express", "Express", {
description: `Servers built with Express and other major Node.js HTTP libraries work out of the box.`,
}),
page("ecosystem/elysia", "Elysia", {
description: `Get started with Elysia, a Bun-native framework designed for the edge.`,
}),
page("ecosystem/hono", "Hono", {
description: `Hono is an ultra-fast, Bun-friendly web framework designed for edge environments.`,
}),
// page("ecosystem/buchta", "Buchta", {
// description: `Buchta is a Bun-native fullstack framework for Svelte and Preact apps.`,
// }),
page("ecosystem/stric", "Stric", {
description: `Stric is a minimalist, fast web framework for Bun.`,
}),
page("ecosystem/awesome", "Awesome", {
href: "https://github.com/apvarun/awesome-bun",
description: ``,
}),
divider("API"),
page("api/http", "HTTP server", {
description: `Bun implements Web-standard fetch, plus a Bun-native API for building fast HTTP servers.`,
}), // "`Bun.serve`"),
page("api/websockets", "WebSockets", {
description: `Bun supports server-side WebSockets with on-the-fly compression, TLS support, and a Bun-native pubsub API.`,
}), // "`Bun.serve`"),
page("api/binary-data", "Binary data", {
description: `How to represent and manipulate binary data in Bun.`,
}), // "`Bun.serve`"),
page("api/streams", "Streams", {
description: `Reading, writing, and manipulating streams of data in Bun.`,
}), // "`Bun.serve`"),
page("api/file-io", "File I/O", {
description: `Read and write files fast with Bun's heavily optimized file system API.`,
}), // "`Bun.write`"),
page("api/import-meta", "import.meta", {
description: `Module-scoped metadata and utilities`,
}), // "`bun:sqlite`"),
page("api/sqlite", "SQLite", {
description: `The fastest SQLite driver for JavaScript is baked directly into Bun.`,
}), // "`bun:sqlite`"),
page("api/file-system-router", "FileSystemRouter", {
description: `Resolve incoming HTTP requests against a local file system directory with Bun's fast, Next.js-compatible router.`,
}), // "`Bun.FileSystemRouter`"),
page("api/tcp", "TCP sockets", {
description: `Bun's native API implements Web-standard TCP Sockets, plus a Bun-native API for building fast TCP servers.`,
}), // "`Bun.{listen|connect}`")
page("api/globals", "Globals", {
description: `Bun implements a range of Web APIs, Node.js APIs, and Bun-native APIs that are available in the global scope.`,
}), // "`Bun.write`"),
page("api/spawn", "Child processes", {
description: `Spawn sync and async child processes with easily configurable input and output streams.`,
}), // "`Bun.spawn`"),
page("api/transpiler", "Transpiler", {
description: `Bun exposes its internal transpiler as a pluggable API.`,
}), // "`Bun.Transpiler`"),
page("api/hashing", "Hashing", {
description: `Native support for a range of fast hashing algorithms.`,
}), // "`Bun.serve`"),
page("api/console", "Console", {
description: `Bun implements a Node.js-compatible \`console\` object with colorized output and deep pretty-printing.`,
}), // "`Node-API`"),
page("api/ffi", "FFI", {
description: `Call native code from JavaScript with Bun's foreign function interface (FFI) API.`,
}), // "`bun:ffi`"),
page("api/html-rewriter", "HTMLRewriter", {
description: `Parse and transform HTML with Bun's native HTMLRewriter API, inspired by Cloudflare Workers.`,
}), // "`HTMLRewriter`"),
page("api/test", "Testing", {
description: `Bun's built-in test runner is fast and uses Jest-compatible syntax.`,
}), // "`bun:test`"),
page("api/utils", "Utils", {
description: `Bun implements a set of utilities that are commonly required by developers.`,
}), // "`Bun.peek`"),
// page("api/dns", "DNS", {
// description: `Resolve domain names to IP addresses.`,
// }), // "`bun:dns`"),
page("api/node-api", "Node-API", {
description: `Bun implements the Node-API spec for building native addons.`,
}), // "`Node-API`"),
// divider("Dev Server"),
// page("bun-dev", "Vanilla"),
// page("dev/css", "CSS"),
// page("dev/frameworks", "Frameworks"),
// page("dev/nextjs", "Next.js"),
// page("dev/cra", "Create React App"),
divider("Project"),
page("project/roadmap", "Roadmap", {
description: `Track Bun's near-term and long-term goals.`,
}),
page("project/benchmarking", "Benchmarking", {
description: `Bun is designed for performance. Learn how to benchmark Bun yourself.`,
}),
page("project/development", "Development", {
description: "Learn how to contribute to Bun and get your local development environment up and running.",
}),
page("project/licensing", "License", {
description: `Bun is a MIT-licensed project with a large number of statically-linked dependencies with various licenses.`,
}),
// misc
// page("roadmap", "Roadmap"),
// page("troubleshooting", "Troubleshooting"),
// page("bunfig", "bunfig.toml"),
// page("upgrading-webkit", "Upgrading WebKit"),
// page("bun-flavored-toml", "Bun-flavored TOML"),
],
} satisfies Nav;
|