initial commit

This commit is contained in:
i2p
2026-08-27 21:09:14 +00:00
commit a5b6d59437
12681 changed files with 3253832 additions and 0 deletions
+176
View File
@@ -0,0 +1,176 @@
## CLI Usage
```bash
bun add <package> <@version>
```
### Dependency Management
<ParamField path="--production" type="boolean">
Don't install devDependencies. Alias: <code>-p</code>
</ParamField>
<ParamField path="--omit" type="string">
Exclude <code>dev</code>, <code>optional</code>, or <code>peer</code> dependencies from install
</ParamField>
<ParamField path="--global" type="boolean">
Install globally. Alias: <code>-g</code>
</ParamField>
<ParamField path="--dev" type="boolean">
Add dependency to <code>devDependencies</code>. Alias: <code>-d</code>
</ParamField>
<ParamField path="--optional" type="boolean">
Add dependency to <code>optionalDependencies</code>
</ParamField>
<ParamField path="--peer" type="boolean">
Add dependency to <code>peerDependencies</code>
</ParamField>
<ParamField path="--exact" type="boolean">
Add the exact version instead of the <code>^</code> range. Alias: <code>-E</code>
</ParamField>
<ParamField path="--only-missing" type="boolean">
Only add dependencies to <code>package.json</code> if they are not already present
</ParamField>
<ParamField path="--catalog" type="string">
Add the resolved version to the root <code>package.json</code> catalog and depend on it as <code>catalog:</code>;{" "}
<code>--catalog=NAME</code> targets <code>catalogs.NAME</code>
</ParamField>
<ParamField path="--filter" type="string">
Add the package(s) to the matching workspaces instead of the current package. Alias: <code>-F</code>
</ParamField>
### Project Files & Lockfiles
<ParamField path="--yarn" type="boolean">
Write a <code>yarn.lock</code> file (yarn v1). Alias: <code>-y</code>
</ParamField>
<ParamField path="--no-save" type="boolean">
Don't update <code>package.json</code> or save a lockfile
</ParamField>
<ParamField path="--save" type="boolean" default="true">
Save to <code>package.json</code>
</ParamField>
<ParamField path="--frozen-lockfile" type="boolean">
Disallow changes to lockfile
</ParamField>
<ParamField path="--trust" type="boolean">
Add to <code>trustedDependencies</code> in the project's <code>package.json</code> and install the package(s)
</ParamField>
<ParamField path="--save-text-lockfile" type="boolean">
Save a text-based lockfile
</ParamField>
<ParamField path="--lockfile-only" type="boolean">
Generate a lockfile without installing dependencies
</ParamField>
### Installation Control
<ParamField path="--dry-run" type="boolean">
Resolve the packages but don't install them, update <code>package.json</code>, or save a lockfile (the project's own
lifecycle scripts still run)
</ParamField>
<ParamField path="--force" type="boolean">
Always request the latest versions from the registry &amp; reinstall all dependencies. Alias: <code>-f</code>
</ParamField>
<ParamField path="--no-verify" type="boolean">
Skip verifying integrity of newly downloaded packages
</ParamField>
<ParamField path="--ignore-scripts" type="boolean">
Skip lifecycle scripts for all packages, including the project's <code>package.json</code> and trusted dependencies
</ParamField>
<ParamField path="--analyze" type="boolean">
Recursively analyze &amp; install dependencies of files passed as arguments (using Bun's bundler). Alias:{" "}
<code>-a</code>
</ParamField>
### Network & Registry
<ParamField path="--ca" type="string">
Provide a Certificate Authority signing certificate
</ParamField>
<ParamField path="--cafile" type="string">
Same as <code>--ca</code>, but as a file path to the certificate
</ParamField>
<ParamField path="--registry" type="string">
Use a specific registry by default, overriding <code>.npmrc</code>, <code>bunfig.toml</code>, and environment
variables
</ParamField>
<ParamField path="--network-concurrency" type="number" default="48">
Maximum number of concurrent network requests
</ParamField>
### Performance &amp; Resource
<ParamField path="--backend" type="string">
Platform-specific optimizations for installing dependencies. Possible values: <code>clonefile</code> (default on
macOS), <code>hardlink</code> (default on Linux and Windows), <code>symlink</code>, <code>copyfile</code>
</ParamField>
<ParamField path="--concurrent-scripts" type="number">
Maximum number of concurrent jobs for lifecycle scripts (default: 2x CPU cores)
</ParamField>
### Caching
<ParamField path="--cache-dir" type="string">
Store &amp; load cached data from a specific directory path
</ParamField>
<ParamField path="--no-cache" type="boolean">
Ignore manifest cache entirely
</ParamField>
### Output &amp; Logging
<ParamField path="--silent" type="boolean">
Don't log anything
</ParamField>
<ParamField path="--verbose" type="boolean">
Excessively verbose logging
</ParamField>
<ParamField path="--no-progress" type="boolean">
Disable the progress bar
</ParamField>
<ParamField path="--no-summary" type="boolean">
Don't print a summary
</ParamField>
### Global Configuration &amp; Context
<ParamField path="--config" type="string">
Specify path to config file (<code>bunfig.toml</code>). Alias: <code>-c</code>
</ParamField>
<ParamField path="--cwd" type="string">
Set a specific current working directory
</ParamField>
### Help
<ParamField path="--help" type="boolean">
Print this help menu. Alias: <code>-h</code>
</ParamField>
+260
View File
@@ -0,0 +1,260 @@
## CLI Usage
```bash
bun build <entry points>
```
### General Configuration
<ParamField path="--production" type="boolean">
Set <code>NODE_ENV=production</code> and enable minification
</ParamField>
<ParamField path="--bytecode" type="boolean">
Use a bytecode cache when compiling
</ParamField>
<ParamField path="--target" type="string" default="browser">
Intended execution environment for the bundle. One of <code>browser</code>, <code>bun</code>, or <code>node</code>
</ParamField>
<ParamField path="--conditions" type="string">
Pass custom resolution conditions
</ParamField>
<ParamField path="--env" type="string" default="disable">
Inline environment variables into the bundle as <code>process.env.${name}</code>. To inline variables matching a
prefix, use a glob like <code>FOO_PUBLIC_*</code>
</ParamField>
### Output & File Handling
<ParamField path="--outdir" type="string" default="dist">
Output directory (used when building multiple entry points)
</ParamField>
<ParamField path="--outfile" type="string">
Write output to a specific file
</ParamField>
<ParamField path="--metafile" type="string">
Write a JSON file with metadata about the build
</ParamField>
<ParamField path="--metafile-md" type="string">
Write a markdown file with a visualization of the module graph (LLM-friendly)
</ParamField>
<ParamField path="--sourcemap" type="string" default="none">
Generate source maps. One of <code>linked</code>, <code>inline</code>, <code>external</code>, or <code>none</code>
</ParamField>
<ParamField path="--banner" type="string">
Add a banner to the output (e.g. <code>"use client"</code> for React Server Components)
</ParamField>
<ParamField path="--footer" type="string">
Add a footer to the output (e.g. <code>// built with bun!</code>)
</ParamField>
<ParamField path="--format" type="string" default="esm">
Module format of the output bundle. One of <code>esm</code>, <code>cjs</code>, or <code>iife</code>. Defaults to{" "}
<code>cjs</code> when <code>--bytecode</code> is used.
</ParamField>
### File Naming
<ParamField path="--entry-naming" type="string" default="[dir]/[name].[ext]">
Customize entry point filenames
</ParamField>
<ParamField path="--chunk-naming" type="string" default="[name]-[hash].[ext]">
Customize chunk filenames
</ParamField>
<ParamField path="--asset-naming" type="string" default="[name]-[hash].[ext]">
Customize asset filenames
</ParamField>
### Bundling Options
<ParamField path="--root" type="string">
Root directory used when bundling multiple entry points
</ParamField>
<ParamField path="--splitting" type="boolean">
Enable code splitting for shared modules
</ParamField>
<ParamField path="--public-path" type="string">
Prefix the bundler adds to import paths in bundled code
</ParamField>
<ParamField path="--external" type="string">
Exclude modules from the bundle (supports wildcards). Alias: <code>-e</code>
</ParamField>
<ParamField path="--allow-unresolved" type="string" default="*">
Allow unresolved dynamic import()/require() specifiers matching these glob patterns. Pass <code>''</code> to allow
opaque specifiers
</ParamField>
<ParamField path="--reject-unresolved" type="boolean">
Fail the build on any dynamic import()/require() specifier that cannot be resolved at build time
</ParamField>
<ParamField path="--packages" type="string" default="bundle">
How to treat dependencies: <code>external</code> or <code>bundle</code>
</ParamField>
<ParamField path="--no-bundle" type="boolean">
Transpile only — do not bundle
</ParamField>
<ParamField path="--css-chunking" type="boolean">
Chunk CSS files together to reduce duplication (only when multiple entry points import CSS)
</ParamField>
### Minification & Optimization
<ParamField path="--emit-dce-annotations" type="boolean" default="true">
Re-emit Dead Code Elimination annotations. Disabled when <code>--minify-whitespace</code> is used
</ParamField>
<ParamField path="--minify" type="boolean">
Enable all minification options
</ParamField>
<ParamField path="--minify-syntax" type="boolean">
Minify syntax and inline constants
</ParamField>
<ParamField path="--minify-whitespace" type="boolean">
Minify whitespace
</ParamField>
<ParamField path="--minify-identifiers" type="boolean">
Minify variable and function identifiers
</ParamField>
<ParamField path="--keep-names" type="boolean">
Preserve original function and class names when minifying
</ParamField>
### Development Features
<ParamField path="--watch" type="boolean">
Rebuild automatically when files change
</ParamField>
<ParamField path="--no-clear-screen" type="boolean">
Dont clear the terminal when rebuilding with <code>--watch</code>
</ParamField>
<ParamField path="--react-fast-refresh" type="boolean">
Enable React Fast Refresh transform (for development testing)
</ParamField>
<ParamField path="--react-compiler" type="boolean">
Run the React Compiler over `.jsx`/`.tsx` files, automatically memoizing components and hooks. The bundler derives the
output mode from `--target` (`browser` → client, `bun`/`node` → ssr). Experimental.
</ParamField>
### Standalone Executables
<ParamField path="--compile" type="boolean">
Generate a standalone Bun executable containing the bundle
</ParamField>
<ParamField path="--compile-exec-argv" type="string">
Prepend arguments to the standalone executables <code>execArgv</code>
</ParamField>
<ParamField path="--compile-autoload-dotenv" type="boolean" default="true">
Enable autoloading of <code>.env</code> files in the standalone executable
</ParamField>
<ParamField path="--no-compile-autoload-dotenv" type="boolean">
Disable autoloading of <code>.env</code> files in the standalone executable
</ParamField>
<ParamField path="--compile-autoload-bunfig" type="boolean" default="true">
Enable autoloading of <code>bunfig.toml</code> in the standalone executable
</ParamField>
<ParamField path="--no-compile-autoload-bunfig" type="boolean">
Disable autoloading of <code>bunfig.toml</code> in the standalone executable
</ParamField>
<ParamField path="--compile-autoload-tsconfig" type="boolean" default="false">
Enable autoloading of <code>tsconfig.json</code> at runtime in the standalone executable
</ParamField>
<ParamField path="--no-compile-autoload-tsconfig" type="boolean">
Disable autoloading of <code>tsconfig.json</code> at runtime in the standalone executable
</ParamField>
<ParamField path="--compile-autoload-package-json" type="boolean" default="false">
Enable autoloading of <code>package.json</code> at runtime in the standalone executable
</ParamField>
<ParamField path="--no-compile-autoload-package-json" type="boolean">
Disable autoloading of <code>package.json</code> at runtime in the standalone executable
</ParamField>
<ParamField path="--compile-executable-path" type="string">
Path to a Bun executable to use for cross-compilation instead of downloading
</ParamField>
<ParamField path="--asset" type="string">
Embed a file or directory into the compiled executable under its basename; a directory keeps its internal tree, so{" "}
<code>--asset ./static/public</code> embeds <code>public/...</code> (requires <code>--compile</code>)
</ParamField>
### Windows Executable Details
<ParamField path="--windows-hide-console" type="boolean">
Prevent a console window from opening when running a compiled Windows executable
</ParamField>
<ParamField path="--windows-icon" type="string">
Set an icon for the Windows executable
</ParamField>
<ParamField path="--windows-title" type="string">
Set the Windows executable product name
</ParamField>
<ParamField path="--windows-publisher" type="string">
Set the Windows executable company name
</ParamField>
<ParamField path="--windows-version" type="string">
Set the Windows executable version (e.g. <code>1.2.3.4</code>)
</ParamField>
<ParamField path="--windows-description" type="string">
Set the Windows executable description
</ParamField>
<ParamField path="--windows-copyright" type="string">
Set the Windows executable copyright notice
</ParamField>
### Experimental & App Building
<ParamField path="--app" type="boolean">
<b>(EXPERIMENTAL)</b> Build a web app for production using Bun Bake
</ParamField>
<ParamField path="--server-components" type="boolean">
<b>(EXPERIMENTAL)</b> Enable React Server Components
</ParamField>
<ParamField path="--debug-dump-server-files" type="boolean">
When <code>--app</code> is set, dump all server files to disk even for static builds
</ParamField>
<ParamField path="--debug-no-minify" type="boolean">
When <code>--app</code> is set, disable all minification
</ParamField>
+49
View File
@@ -0,0 +1,49 @@
## Usage
```bash
bunx [flags] <package>[@version] [flags and arguments for the package]
```
Execute an npm package executable (CLI). If the package isn't installed in `node_modules`, Bun installs it into a global shared cache.
### Flags
<ParamField path="--bun" type="boolean">
Force the command to run with Bun instead of Node.js, even if the executable contains a Node shebang (`#!/usr/bin/env
node`)
</ParamField>
<ParamField path="-p, --package" type="string">
Specify package to install when binary name differs from package name
</ParamField>
<ParamField path="--no-install" type="boolean">
Skip installation if package is not already installed
</ParamField>
<ParamField path="--verbose" type="boolean">
Enable verbose output during installation
</ParamField>
<ParamField path="--silent" type="boolean">
Suppress output during installation
</ParamField>
### Examples
```bash terminal icon="terminal"
# Run Prisma migrations
bunx prisma migrate
# Format a file with Prettier
bunx prettier foo.js
# Run a specific version of a package
bunx [email protected] app.js
# Use --package when binary name differs from package name
bunx -p @angular/cli ng new my-app
# Force running with Bun instead of Node.js, even if the executable contains a Node shebang
bunx --bun vite dev foo.js
```
+78
View File
@@ -0,0 +1,78 @@
## CLI Usage
```bash terminal icon="terminal"
bun init <folder?>
```
### Initialization Options
<ParamField path="--yes" type="boolean">
{" "}
Accept all default prompts without asking questions. Alias: <code>-y</code>{" "}
</ParamField>
<ParamField path="--minimal" type="boolean">
{" "}
Only initialize type definitions (skip app scaffolding). Alias: <code>-m</code>{" "}
</ParamField>
### Project Templates
<ParamField path="--react" type="string|boolean">
{" "}
Scaffold a React project. When used without a value, creates a baseline React app.
<br /> Accepts values for presets:{" "}
<ul>
{" "}
<li>
<code>tailwind</code> React app preconfigured with Tailwind CSS
</li>{" "}
<li>
<code>shadcn</code> React app with <code>@shadcn/ui</code> and Tailwind CSS
</li>{" "}
</ul>{" "}
Examples:{" "}
<pre>
<code>
bun init --react{"\n"}bun init --react=tailwind{"\n"}bun init --react=shadcn
</code>
</pre>{" "}
</ParamField>
### Output & Files
<ParamField path="(result)" type="info">
{" "}
Initializes project files and configuration for the chosen options. Exact files vary by template.{" "}
</ParamField>
### Help
<ParamField path="--help" type="boolean">
{" "}
Print this help menu. Alias: <code>-h</code>{" "}
</ParamField>
### Examples
- Accept all defaults
```bash terminal icon="terminal"
bun init -y
```
- React
```bash terminal icon="terminal"
bun init --react
```
- React + Tailwind CSS
```bash terminal icon="terminal"
bun init --react=tailwind
```
- React + @shadcn/ui
```bash terminal icon="terminal"
bun init --react=shadcn
```
+174
View File
@@ -0,0 +1,174 @@
## CLI Usage
```sh terminal icon="terminal"
bun install <name>@<version>
```
### General Configuration
<ParamField path="--config" type="string">
Specify path to config file (bunfig.toml)
</ParamField>
<ParamField path="--cwd" type="string">
Set a specific cwd
</ParamField>
### Dependency Scope & Management
<ParamField path="--production" type="boolean">
Don't install devDependencies
</ParamField>
<ParamField path="--no-save" type="boolean">
Don't update package.json or save a lockfile
</ParamField>
<ParamField path="--save" type="boolean" default="true">
Save to package.json
</ParamField>
<ParamField path="--omit" type="string">
Exclude 'dev', 'optional', or 'peer' dependencies from install
</ParamField>
<ParamField path="--only-missing" type="boolean">
Only add dependencies to package.json if they are not already present
</ParamField>
### Dependency Type & Versioning
<ParamField path="--dev" type="boolean">
Add dependency to "devDependencies"
</ParamField>
<ParamField path="--optional" type="boolean">
Add dependency to "optionalDependencies"
</ParamField>
<ParamField path="--peer" type="boolean">
Add dependency to "peerDependencies"
</ParamField>
<ParamField path="--exact" type="boolean">
Add the exact version instead of the ^ range
</ParamField>
### Lockfile Control
<ParamField path="--yarn" type="boolean">
Write a yarn.lock file (yarn v1)
</ParamField>
<ParamField path="--frozen-lockfile" type="boolean">
Disallow changes to lockfile
</ParamField>
<ParamField path="--save-text-lockfile" type="boolean">
Save a text-based lockfile
</ParamField>
<ParamField path="--lockfile-only" type="boolean">
Generate a lockfile without installing dependencies
</ParamField>
### Network & Registry Settings
<ParamField path="--ca" type="string">
Provide a Certificate Authority signing certificate
</ParamField>
<ParamField path="--cafile" type="string">
File path to Certificate Authority signing certificate
</ParamField>
<ParamField path="--registry" type="string">
Use a specific registry by default, overriding .npmrc, bunfig.toml and environment variables
</ParamField>
### Installation Process Control
<ParamField path="--dry-run" type="boolean">
Resolve dependencies but don't install packages, update package.json, or save a lockfile (the project's own lifecycle
scripts still run)
</ParamField>
<ParamField path="--force" type="boolean">
Always request the latest versions from the registry & reinstall all dependencies
</ParamField>
<ParamField path="--global" type="boolean">
Install globally
</ParamField>
<ParamField path="--backend" type="string">
Platform-specific optimizations: "clonefile", "hardlink", "symlink", "copyfile"
</ParamField>
<ParamField path="--filter" type="string">
Install packages for the matching workspaces
</ParamField>
<ParamField path="--analyze" type="boolean">
Recursively analyze & install all dependencies of files passed as arguments
</ParamField>
### Caching Options
<ParamField path="--cache-dir" type="string">
Store & load cached data from a specific directory path
</ParamField>
<ParamField path="--no-cache" type="boolean">
Ignore manifest cache entirely
</ParamField>
### Output & Logging
<ParamField path="--silent" type="boolean">
Don't log anything
</ParamField>
<ParamField path="--verbose" type="boolean">
Excessively verbose logging
</ParamField>
<ParamField path="--no-progress" type="boolean">
Disable the progress bar
</ParamField>
<ParamField path="--no-summary" type="boolean">
Don't print a summary
</ParamField>
### Security & Integrity
<ParamField path="--no-verify" type="boolean">
Skip verifying integrity of newly downloaded packages
</ParamField>
<ParamField path="--trust" type="boolean">
Add to trustedDependencies in the project's package.json and install the package(s)
</ParamField>
### Concurrency & Performance
<ParamField path="--concurrent-scripts" type="number">
Maximum number of concurrent jobs for lifecycle scripts (default: 2x CPU cores)
</ParamField>
<ParamField path="--network-concurrency" type="number" default="48">
Maximum number of concurrent network requests
</ParamField>
### Lifecycle Script Management
<ParamField path="--ignore-scripts" type="boolean">
Skip lifecycle scripts for all packages, including the project's package.json and trusted dependencies
</ParamField>
### Help Information
<ParamField path="--help" type="boolean">
Print this help menu
</ParamField>
+164
View File
@@ -0,0 +1,164 @@
# CLI Usage
```bash
bun link <packages>
```
### Installation Scope
<ParamField path="--global" type="boolean">
Install globally. Alias: <code>-g</code>
</ParamField>
### Dependency Management
<ParamField path="--production" type="boolean">
Don't install devDependencies. Alias: <code>-p</code>
</ParamField>
<ParamField path="--omit" type="string">
Exclude <code>dev</code>, <code>optional</code>, or <code>peer</code> dependencies from install
</ParamField>
### Project Files &amp; Lockfiles
<ParamField path="--yarn" type="boolean">
Write a <code>yarn.lock</code> file (yarn v1). Alias: <code>-y</code>
</ParamField>
<ParamField path="--frozen-lockfile" type="boolean">
Disallow changes to lockfile
</ParamField>
<ParamField path="--save-text-lockfile" type="boolean">
Save a text-based lockfile
</ParamField>
<ParamField path="--lockfile-only" type="boolean">
Generate a lockfile without installing dependencies
</ParamField>
<ParamField path="--no-save" type="boolean">
Has no effect. <code>bun link</code> updates <code>package.json</code> and the lockfile only with <code>--save</code>
</ParamField>
<ParamField path="--save" type="boolean">
Save to <code>package.json</code>
</ParamField>
<ParamField path="--trust" type="boolean">
Add to <code>trustedDependencies</code> in the project's <code>package.json</code> and install the package(s)
</ParamField>
### Installation Control
<ParamField path="--force" type="boolean">
Always request the latest versions from the registry &amp; reinstall all dependencies. Alias: <code>-f</code>
</ParamField>
<ParamField path="--no-verify" type="boolean">
Skip verifying integrity of newly downloaded packages
</ParamField>
<ParamField path="--backend" type="string">
Platform-specific optimizations for installing dependencies. One of <code>clonefile</code>, <code>hardlink</code>,{" "}
<code>symlink</code>, or <code>copyfile</code>
</ParamField>
<ParamField path="--linker" type="string">
Linker strategy (one of <code>isolated</code> or <code>hoisted</code>)
</ParamField>
<ParamField path="--dry-run" type="boolean">
With <code>bun link &lt;package&gt;</code>, resolve but don't install packages, update <code>package.json</code>, or
save a lockfile. Has no effect on bare <code>bun link</code>, which still registers the current package
</ParamField>
<ParamField path="--ignore-scripts" type="boolean">
Skip lifecycle scripts for all packages, including the project's <code>package.json</code> and trusted dependencies
</ParamField>
### Network &amp; Registry
<ParamField path="--ca" type="string">
Provide a Certificate Authority signing certificate
</ParamField>
<ParamField path="--cafile" type="string">
Same as <code>--ca</code>, but as a file path to the certificate
</ParamField>
<ParamField path="--registry" type="string">
Use a specific registry by default, overriding <code>.npmrc</code>, <code>bunfig.toml</code>, and environment
variables
</ParamField>
<ParamField path="--network-concurrency" type="number" default="48">
Maximum number of concurrent network requests
</ParamField>
### Performance &amp; Resource
<ParamField path="--concurrent-scripts" type="number">
Maximum number of concurrent jobs for lifecycle scripts (default: 2x CPU cores)
</ParamField>
### Caching
<ParamField path="--cache-dir" type="string">
Store &amp; load cached data from a specific directory path
</ParamField>
<ParamField path="--no-cache" type="boolean">
Ignore manifest cache entirely
</ParamField>
### Output &amp; Logging
<ParamField path="--silent" type="boolean">
Don't log anything
</ParamField>
<ParamField path="--quiet" type="boolean">
Disable the progress bar
</ParamField>
<ParamField path="--verbose" type="boolean">
Excessively verbose logging
</ParamField>
<ParamField path="--no-progress" type="boolean">
Disable the progress bar
</ParamField>
<ParamField path="--no-summary" type="boolean">
Don't print a summary
</ParamField>
### Platform Targeting
<ParamField path="--cpu" type="string">
Override CPU architecture for optional dependencies (e.g., <code>x64</code>, <code>arm64</code>, <code>*</code> for
all)
</ParamField>
<ParamField path="--os" type="string">
Override operating system for optional dependencies (e.g., <code>linux</code>, <code>darwin</code>, <code>*</code> for
all)
</ParamField>
### Global Configuration &amp; Context
<ParamField path="--config" type="string">
Specify path to config file (<code>bunfig.toml</code>). Alias: <code>-c</code>
</ParamField>
<ParamField path="--cwd" type="string">
Set a specific current working directory
</ParamField>
### Help
<ParamField path="--help" type="boolean">
Print this help menu. Alias: <code>-h</code>
</ParamField>
+144
View File
@@ -0,0 +1,144 @@
## CLI Usage
```bash terminal icon="terminal"
bun outdated <filter>
```
### General Options
<ParamField path="-c, --config" type="string">
Specify path to config file (<code>bunfig.toml</code>)
</ParamField>
<ParamField path="--cwd" type="string">
Set a specific cwd
</ParamField>
<ParamField path="-h, --help" type="boolean">
Print this help menu
</ParamField>
<ParamField path="-F, --filter" type="string">
Display outdated dependencies for each matching workspace
</ParamField>
<ParamField path="-r, --recursive" type="boolean">
Check outdated packages in all workspaces
</ParamField>
### Output & Logging
<ParamField path="--silent" type="boolean">
Don't log anything
</ParamField>
<ParamField path="--verbose" type="boolean">
Excessively verbose logging
</ParamField>
<ParamField path="--no-progress" type="boolean">
Disable the progress bar
</ParamField>
<ParamField path="--no-summary" type="boolean">
Don't print a summary
</ParamField>
### Dependency Scope & Target
<ParamField path="-p, --production" type="boolean">
Don't install devDependencies
</ParamField>
<ParamField path="--omit" type="string">
Exclude <code>dev</code>, <code>optional</code>, or <code>peer</code> dependencies from install
</ParamField>
<ParamField path="-g, --global" type="boolean">
Install globally
</ParamField>
### Lockfile & Package.json
<ParamField path="-y, --yarn" type="boolean">
Write a <code>yarn.lock</code> file (yarn v1)
</ParamField>
<ParamField path="--no-save" type="boolean">
Don't update <code>package.json</code> or save a lockfile
</ParamField>
<ParamField path="--save" type="boolean" default="true">
Save to <code>package.json</code> (true by default)
</ParamField>
<ParamField path="--frozen-lockfile" type="boolean">
Disallow changes to lockfile
</ParamField>
<ParamField path="--save-text-lockfile" type="boolean">
Save a text-based lockfile
</ParamField>
<ParamField path="--lockfile-only" type="boolean">
Generate a lockfile without installing dependencies
</ParamField>
<ParamField path="--trust" type="boolean">
Add to <code>trustedDependencies</code> in the project's <code>package.json</code> and install the package(s)
</ParamField>
### Network & Registry
<ParamField path="--ca" type="string">
Provide a Certificate Authority signing certificate
</ParamField>
<ParamField path="--cafile" type="string">
Same as <code>--ca</code>, but as a file path to the certificate
</ParamField>
<ParamField path="--registry" type="string">
Use a specific registry by default, overriding <code>.npmrc</code>, <code>bunfig.toml</code> and environment variables
</ParamField>
<ParamField path="--network-concurrency" type="number" default="48">
Maximum number of concurrent network requests (default 48)
</ParamField>
### Caching
<ParamField path="--cache-dir" type="string">
Store &amp; load cached data from a specific directory path
</ParamField>
<ParamField path="--no-cache" type="boolean">
Ignore manifest cache entirely
</ParamField>
### Execution Behavior
<ParamField path="--dry-run" type="boolean">
Has no effect. <code>bun outdated</code> is read-only
</ParamField>
<ParamField path="-f, --force" type="boolean">
Always request the latest versions from the registry &amp; reinstall all dependencies
</ParamField>
<ParamField path="--no-verify" type="boolean">
Skip verifying integrity of newly downloaded packages
</ParamField>
<ParamField path="--ignore-scripts" type="boolean">
Skip lifecycle scripts for all packages, including the project's <code>package.json</code> and trusted dependencies
</ParamField>
<ParamField path="--backend" type="string">
Platform-specific optimizations for installing dependencies. Possible values: <code>clonefile</code> (default on
macOS), <code>hardlink</code> (default on Linux and Windows), <code>symlink</code>, <code>copyfile</code>
</ParamField>
<ParamField path="--concurrent-scripts" type="number">
Maximum number of concurrent jobs for lifecycle scripts (default: 2x CPU cores)
</ParamField>
+176
View File
@@ -0,0 +1,176 @@
# CLI Usage
```bash
bun patch <package>@<version>
```
### Patch Generation
<ParamField path="--commit" type="boolean">
Install a package containing modifications in <code>dir</code>
</ParamField>
<ParamField path="--patches-dir" type="string">
The directory to put the patch file in (only if --commit is used)
</ParamField>
### Dependency Management
<ParamField path="--production" type="boolean">
Don't install devDependencies. Alias: <code>-p</code>
</ParamField>
<ParamField path="--ignore-scripts" type="boolean">
Skip lifecycle scripts for all packages, including the project's <code>package.json</code> and trusted dependencies
</ParamField>
<ParamField path="--trust" type="boolean">
Add to <code>trustedDependencies</code> in the project's <code>package.json</code> and install the package(s)
</ParamField>
<ParamField path="--global" type="boolean">
Install globally. Alias: <code>-g</code>
</ParamField>
<ParamField path="--omit" type="string">
Exclude <code>dev</code>, <code>optional</code>, or <code>peer</code> dependencies from install
</ParamField>
### Project Files &amp; Lockfiles
<ParamField path="--yarn" type="boolean">
Write a <code>yarn.lock</code> file (yarn v1). Alias: <code>-y</code>
</ParamField>
<ParamField path="--no-save" type="boolean">
Don't update <code>package.json</code> or save a lockfile
</ParamField>
<ParamField path="--save" type="boolean" default="true">
Save to <code>package.json</code> (true by default)
</ParamField>
<ParamField path="--frozen-lockfile" type="boolean">
Disallow changes to lockfile
</ParamField>
<ParamField path="--save-text-lockfile" type="boolean">
Save a text-based lockfile
</ParamField>
<ParamField path="--lockfile-only" type="boolean">
Generate a lockfile without installing dependencies
</ParamField>
### Installation Control
<ParamField path="--backend" type="string">
Platform-specific optimizations for installing dependencies. Possible values: <code>clonefile</code> (default on
macOS), <code>hardlink</code> (default on Linux and Windows), <code>symlink</code>, <code>copyfile</code>
</ParamField>
<ParamField path="--linker" type="string">
Linker strategy (one of <code>isolated</code> or <code>hoisted</code>)
</ParamField>
<ParamField path="--minimum-release-age" type="number">
Only install packages published at least N seconds ago (security feature)
</ParamField>
<ParamField path="--dry-run" type="boolean">
Don't install packages, update <code>package.json</code>, or save a lockfile. The package is still copied into{" "}
<code>node_modules</code> for patching, and <code>--commit</code> still writes the patch file
</ParamField>
<ParamField path="--force" type="boolean">
Always request the latest versions from the registry &amp; reinstall all dependencies. Alias: <code>-f</code>
</ParamField>
<ParamField path="--no-verify" type="boolean">
Skip verifying integrity of newly downloaded packages
</ParamField>
### Network &amp; Registry
<ParamField path="--ca" type="string">
Provide a Certificate Authority signing certificate
</ParamField>
<ParamField path="--cafile" type="string">
Same as <code>--ca</code>, but as a file path to the certificate
</ParamField>
<ParamField path="--registry" type="string">
Use a specific registry by default, overriding <code>.npmrc</code>, <code>bunfig.toml</code>, and environment
variables
</ParamField>
<ParamField path="--network-concurrency" type="number" default="48">
Maximum number of concurrent network requests (default 48)
</ParamField>
### Performance &amp; Resource
<ParamField path="--concurrent-scripts" type="number">
Maximum number of concurrent jobs for lifecycle scripts (default: 2x CPU cores)
</ParamField>
### Caching
<ParamField path="--cache-dir" type="string">
Store &amp; load cached data from a specific directory path
</ParamField>
<ParamField path="--no-cache" type="boolean">
Ignore manifest cache entirely
</ParamField>
### Output &amp; Logging
<ParamField path="--silent" type="boolean">
Don't log anything
</ParamField>
<ParamField path="--quiet" type="boolean">
Disable the progress bar
</ParamField>
<ParamField path="--verbose" type="boolean">
Excessively verbose logging
</ParamField>
<ParamField path="--no-progress" type="boolean">
Disable the progress bar
</ParamField>
<ParamField path="--no-summary" type="boolean">
Don't print a summary
</ParamField>
### Platform Targeting
<ParamField path="--cpu" type="string">
Override CPU architecture for optional dependencies (e.g., <code>x64</code>, <code>arm64</code>, <code>*</code> for
all)
</ParamField>
<ParamField path="--os" type="string">
Override operating system for optional dependencies (e.g., <code>linux</code>, <code>darwin</code>, <code>*</code> for
all)
</ParamField>
### Global Configuration &amp; Context
<ParamField path="--config" type="string">
Specify path to config file (<code>bunfig.toml</code>). Alias: <code>-c</code>
</ParamField>
<ParamField path="--cwd" type="string">
Set a specific current working directory
</ParamField>
### Help
<ParamField path="--help" type="boolean">
Print this help menu. Alias: <code>-h</code>
</ParamField>
+204
View File
@@ -0,0 +1,204 @@
## CLI Usage
```bash terminal icon="terminal"
bun publish dist
```
### Publishing Options
<ParamField path="--access" type="string">
Set the access level of the package being published, either `public` or `restricted`. Unscoped packages are always public; publishing an unscoped package with `--access restricted` is an error.
```sh terminal icon="terminal"
bun publish --access public
```
You can also set `--access` in the `publishConfig` field of your `package.json`.
```json package.json icon="file-json"
{
"publishConfig": {
"access": "restricted" // [!code ++]
}
}
```
</ParamField>
<ParamField path="--tag" type="string" default="latest">
Set the tag of the package version being published. By default, the tag is `latest`. The initial version of a package is always given the `latest` tag in addition to the specified tag.
```sh terminal icon="terminal"
bun publish --tag alpha
```
You can also set `--tag` in the `publishConfig` field of your `package.json`.
```json package.json icon="file-json"
{
"publishConfig": {
"tag": "next" // [!code ++]
}
}
```
</ParamField>
<ParamField path="--dry-run" type="boolean">
Simulate the publish process without publishing the package, to verify its contents first.
```sh
bun publish --dry-run
```
</ParamField>
<ParamField path="--tolerate-republish" type="boolean">
`bun publish` exits with code 0 instead of 1 when the version being published already exists in the registry.
</ParamField>
<ParamField path="--gzip-level" type="string" default="9">
Specify the level of gzip compression to use when packing the package. Only applies to `bun publish` without a tarball
path argument. Values range from `0` to `9` (default is `9`).
</ParamField>
<ParamField path="--auth-type" type="string" default="web">
If you have 2FA enabled for your npm account, `bun publish` prompts you for a one-time password, either through a browser or the CLI. `--auth-type` tells the npm registry which method you prefer: `web` (the default) or `legacy`.
```sh terminal icon="terminal"
bun publish --auth-type legacy
...
This operation requires a one-time password.
Enter OTP: 123456
...
```
</ParamField>
<ParamField path="--otp" type="string">
Provide a one-time password directly to the CLI. A valid password skips the extra one-time password prompt before publishing.
```sh terminal icon="terminal"
bun publish --otp 123456
```
<Note>
`bun publish` respects the `NPM_CONFIG_TOKEN` environment variable, so you can publish from GitHub Actions or other
automated workflows.
</Note>
</ParamField>
### Registry Configuration
#### Custom Registry
<ParamField path="--registry" type="string">
Use a specific registry by default, overriding .npmrc, bunfig.toml and environment variables. A registry configured
for the package's scope (`@scope:registry=` in .npmrc or `[install.scopes]` in bunfig.toml) still takes precedence.
</ParamField>
```bash
bun publish --registry https://my-private-registry.com
```
#### SSL Certificates
<ParamField path="--ca" type="string">
Provide Certificate Authority signing certificate
</ParamField>
<ParamField path="--cafile" type="string">
Path to Certificate Authority certificate file
</ParamField>
<CodeGroup>
```bash Inline Certificate
bun publish --ca "-----BEGIN CERTIFICATE-----..."
```
```bash Certificate File
bun publish --cafile ./ca-cert.pem
```
</CodeGroup>
### General Options
#### Dependency Management
<ParamField path="-p, --production" type="boolean">
Don't install devDependencies
</ParamField>
<ParamField path="--omit" type="string">
Exclude dependency types: `dev`, `optional`, or `peer`
</ParamField>
<ParamField path="-f, --force" type="boolean">
Always request the latest versions from the registry & reinstall all dependencies
</ParamField>
#### Script Control
<ParamField path="--ignore-scripts" type="boolean">
Skip lifecycle scripts during packing and publishing
</ParamField>
<ParamField path="--trust" type="boolean">
Add packages to trustedDependencies and run their scripts
</ParamField>
<Note>
**Lifecycle Scripts** — When you publish a pre-built tarball, Bun does not run lifecycle scripts such as
`prepublishOnly` and `prepack`; they only run when Bun packs the package itself.
</Note>
#### File Management
<ParamField path="--no-save" type="boolean">
Don't update package.json or lockfile
</ParamField>
<ParamField path="--frozen-lockfile" type="boolean">
Disallow changes to lockfile
</ParamField>
<ParamField path="--yarn" type="boolean">
Generate yarn.lock file (yarn v1 compatible)
</ParamField>
#### Performance
<ParamField path="--backend" type="string">
Platform optimizations: `clonefile` (default on macOS), `hardlink` (default on Linux and Windows), `symlink`, or
`copyfile`
</ParamField>
<ParamField path="--network-concurrency" type="number" default="48">
Maximum concurrent network requests
</ParamField>
<ParamField path="--concurrent-scripts" type="number">
Maximum concurrent lifecycle scripts (default: 2x CPU cores)
</ParamField>
#### Output Control
<ParamField path="--silent" type="boolean">
Suppress all output
</ParamField>
<ParamField path="--verbose" type="boolean">
Show detailed logging
</ParamField>
<ParamField path="--no-progress" type="boolean">
Hide progress bar
</ParamField>
<ParamField path="--no-summary" type="boolean">
Don't print publish summary
</ParamField>
+151
View File
@@ -0,0 +1,151 @@
## CLI Usage
```bash terminal icon="terminal"
bun remove <package>
```
### General Information
<ParamField path="--help" type="boolean">
Print this help menu. Alias: <code>-h</code>
</ParamField>
### Configuration
<ParamField path="--config" type="string">
Specify path to config file (<code>bunfig.toml</code>). Alias: <code>-c</code>
</ParamField>
### Package.json Interaction
<ParamField path="--no-save" type="boolean">
Don't update <code>package.json</code> or save a lockfile
</ParamField>
<ParamField path="--save" type="boolean" default="true">
Save to <code>package.json</code> (true by default)
</ParamField>
<ParamField path="--trust" type="boolean">
Add to <code>trustedDependencies</code> in the project's <code>package.json</code> and install the package(s)
</ParamField>
<ParamField path="--filter" type="string">
Remove the package(s) from the matching workspaces instead of the current package. Alias: <code>-F</code>
</ParamField>
### Lockfile Behavior
<ParamField path="--yarn" type="boolean">
Write a <code>yarn.lock</code> file (yarn v1). Alias: <code>-y</code>
</ParamField>
<ParamField path="--frozen-lockfile" type="boolean">
Disallow changes to lockfile
</ParamField>
<ParamField path="--save-text-lockfile" type="boolean">
Save a text-based lockfile
</ParamField>
<ParamField path="--lockfile-only" type="boolean">
Generate a lockfile without installing dependencies
</ParamField>
### Dependency Filtering
<ParamField path="--production" type="boolean">
Don't install devDependencies. Alias: <code>-p</code>
</ParamField>
<ParamField path="--omit" type="string">
Exclude <code>dev</code>, <code>optional</code>, or <code>peer</code> dependencies from install
</ParamField>
### Network & Registry
<ParamField path="--ca" type="string">
Provide a Certificate Authority signing certificate
</ParamField>
<ParamField path="--cafile" type="string">
Same as <code>--ca</code>, but as a file path to the certificate
</ParamField>
<ParamField path="--registry" type="string">
Use a specific registry by default, overriding <code>.npmrc</code>, <code>bunfig.toml</code> and environment variables
</ParamField>
### Execution Control & Validation
<ParamField path="--dry-run" type="boolean">
Resolve the change but don't remove packages, update <code>package.json</code>, or save a lockfile (the project's own
lifecycle scripts still run)
</ParamField>
<ParamField path="--force" type="boolean">
Always request the latest versions from the registry &amp; reinstall all dependencies. Alias: <code>-f</code>
</ParamField>
<ParamField path="--no-verify" type="boolean">
Skip verifying integrity of newly downloaded packages
</ParamField>
### Output & Logging
<ParamField path="--silent" type="boolean">
Don't log anything
</ParamField>
<ParamField path="--verbose" type="boolean">
Excessively verbose logging
</ParamField>
<ParamField path="--no-progress" type="boolean">
Disable the progress bar
</ParamField>
<ParamField path="--no-summary" type="boolean">
Don't print a summary
</ParamField>
### Caching
<ParamField path="--cache-dir" type="string">
Store &amp; load cached data from a specific directory path
</ParamField>
<ParamField path="--no-cache" type="boolean">
Ignore manifest cache entirely
</ParamField>
### Script Execution
<ParamField path="--ignore-scripts" type="boolean">
Skip lifecycle scripts for all packages, including the project's <code>package.json</code> and trusted dependencies
</ParamField>
<ParamField path="--concurrent-scripts" type="number">
Maximum number of concurrent jobs for lifecycle scripts (default: 2x CPU cores)
</ParamField>
### Scope & Path
<ParamField path="--global" type="boolean">
Install globally. Alias: <code>-g</code>
</ParamField>
<ParamField path="--cwd" type="string">
Set a specific cwd
</ParamField>
### Advanced & Performance
<ParamField path="--backend" type="string">
Platform-specific optimizations for installing dependencies. Possible values: <code>clonefile</code> (default on
macOS), <code>hardlink</code> (default on Linux and Windows), <code>symlink</code>, <code>copyfile</code>
</ParamField>
<ParamField path="--network-concurrency" type="number" default="48">
Maximum number of concurrent network requests (default 48)
</ParamField>
+316
View File
@@ -0,0 +1,316 @@
# CLI Usage
```bash
bun run <file or script>
```
### General Execution Options
<ParamField path="--silent" type="boolean">
Don't print the script command
</ParamField>
<ParamField path="--if-present" type="boolean">
Exit without an error if the entrypoint does not exist
</ParamField>
<ParamField path="--eval" type="string">
Evaluate argument as a script. Alias: <code>-e</code>
</ParamField>
<ParamField path="--print" type="string">
Evaluate argument as a script and print the result. Alias: <code>-p</code>
</ParamField>
<ParamField path="--help" type="boolean">
Display this menu and exit. Alias: <code>-h</code>
</ParamField>
### Workspace Management
<ParamField path="--elide-lines" type="number" default="10">
Number of lines of script output shown when using --filter (default: 10). Set to 0 to show all lines
</ParamField>
<ParamField path="--filter" type="string">
Run a script in all workspace packages matching the pattern. Alias: <code>-F</code>
</ParamField>
<ParamField path="--workspaces" type="boolean">
Run a script in all workspace packages (from the <code>workspaces</code> field in <code>package.json</code>)
</ParamField>
<ParamField path="--parallel" type="boolean">
Run multiple scripts or workspace scripts concurrently with prefixed output
</ParamField>
<ParamField path="--sequential" type="boolean">
Run multiple scripts or workspace scripts one after another with prefixed output
</ParamField>
<ParamField path="--no-exit-on-error" type="boolean">
When using <code>--parallel</code> or <code>--sequential</code>, continue running other scripts when one fails
</ParamField>
### Runtime &amp; Process Control
<ParamField path="--bun" type="boolean">
Force a script or package to use Bun's runtime instead of Node.js (via symlinking node). Alias: <code>-b</code>
</ParamField>
<ParamField path="--shell" type="string">
Control the shell used for <code>package.json</code> scripts. Supports either <code>bun</code> or <code>system</code>
</ParamField>
<ParamField path="--interactive" type="boolean">
Open the Node.js-compatible REPL (<code>node:repl</code>). When combined with <code>-e</code>, starts the REPL and
then evaluates the script. Under <code>--interactive</code>, <code>-e</code> is raw JavaScript (matching{" "}
<code>node -i -e</code>). Use <code>bun repl</code> for TypeScript. Distinct from <code>bun repl</code>, which is
Bun's native REPL.
</ParamField>
<ParamField path="--smol" type="boolean">
Use less memory, but run garbage collection more often
</ParamField>
<ParamField path="--expose-gc" type="boolean">
Expose <code>gc()</code> on the global object. Has no effect on <code>Bun.gc()</code>
</ParamField>
<ParamField path="--no-deprecation" type="boolean">
Silence all deprecation warnings
</ParamField>
<ParamField path="--throw-deprecation" type="boolean">
Throw deprecation warnings as errors
</ParamField>
<ParamField path="--title" type="string">
Set the process title
</ParamField>
<ParamField path="--zero-fill-buffers" type="boolean">
Force <code>Buffer.allocUnsafe(size)</code> to be zero-filled
</ParamField>
<ParamField path="--no-addons" type="boolean">
Throw an error if <code>process.dlopen</code> is called, and disable export condition <code>node-addons</code>
</ParamField>
<ParamField path="--unhandled-rejections" type="string">
One of <code>strict</code>, <code>throw</code>, <code>warn</code>, <code>none</code>, or{" "}
<code>warn-with-error-code</code>
</ParamField>
<ParamField path="--console-depth" type="number" default="2">
Set the default depth for <code>console.log</code> object inspection (default: 2)
</ParamField>
### Development Workflow
<ParamField path="--watch" type="boolean">
Automatically restart the process on file change
</ParamField>
<ParamField path="--watch-kill-signal" type="string" default="SIGTERM">
Signal whose handlers run when --watch restarts the process
</ParamField>
<ParamField path="--hot" type="boolean">
Enable auto reload in the Bun runtime, test runner, or bundler
</ParamField>
<ParamField path="--no-clear-screen" type="boolean">
Disable clearing the terminal screen on reload when --hot or --watch is enabled
</ParamField>
### Debugging
<ParamField path="--inspect" type="string">
Activate Bun's debugger
</ParamField>
<ParamField path="--inspect-wait" type="string">
Activate Bun's debugger, wait for a connection before executing
</ParamField>
<ParamField path="--inspect-brk" type="string">
Activate Bun's debugger, set breakpoint on first line of code and wait
</ParamField>
### Dependency &amp; Module Resolution
<ParamField path="--preload" type="string">
Import a module before Bun loads other modules. Alias: <code>-r</code>
</ParamField>
<ParamField path="--require" type="string">
Alias of --preload, for Node.js compatibility
</ParamField>
<ParamField path="--import" type="string">
Alias of --preload, for Node.js compatibility
</ParamField>
<ParamField path="--no-install" type="boolean">
Disable auto install in the Bun runtime
</ParamField>
<ParamField path="--install" type="string" default="auto">
Configure auto-install behavior. One of <code>auto</code> (default, auto-installs when no node_modules),{" "}
<code>fallback</code> (missing packages only), <code>force</code> (always)
</ParamField>
<ParamField path="-i" type="boolean">
Auto-install dependencies during execution. Equivalent to --install=fallback
</ParamField>
<ParamField path="--prefer-offline" type="boolean">
Skip staleness checks for packages in the Bun runtime and resolve from disk
</ParamField>
<ParamField path="--prefer-latest" type="boolean">
Use the latest matching versions of packages in the Bun runtime, always checking npm
</ParamField>
<ParamField path="--conditions" type="string">
Pass custom conditions to resolve
</ParamField>
<ParamField path="--main-fields" type="string">
Main fields to lookup in <code>package.json</code>
</ParamField>
<ParamField path="--preserve-symlinks" type="boolean">
Preserve symlinks when resolving files
</ParamField>
<ParamField path="--preserve-symlinks-main" type="boolean">
Preserve symlinks when resolving the main entry point
</ParamField>
<ParamField path="--extension-order" type="string" default=".tsx,.ts,.jsx,.cts,.cjs,.js,.mjs,.mts,.json,.node">
Defaults to: <code>.tsx,.ts,.jsx,.cts,.cjs,.js,.mjs,.mts,.json,.node</code>
</ParamField>
### Transpilation &amp; Language Features
<ParamField path="--tsconfig-override" type="string">
Specify custom <code>tsconfig.json</code>. Default <code>$cwd/tsconfig.json</code>
</ParamField>
<ParamField path="--define" type="string">
Substitute K:V while parsing, e.g. <code>--define process.env.NODE_ENV:"development"</code>. Bun parses values as
JSON. Alias: <code>-d</code>
</ParamField>
<ParamField path="--drop" type="string">
Remove function calls, e.g. <code>--drop=console</code> removes all <code>console.*</code> calls
</ParamField>
<ParamField path="--loader" type="string">
Parse files with <code>.ext:loader</code>, e.g. <code>--loader .js:jsx</code>. Valid loaders: <code>js</code>,{" "}
<code>jsx</code>, <code>ts</code>, <code>tsx</code>, <code>json</code>, <code>toml</code>, <code>text</code>,{" "}
<code>file</code>, <code>wasm</code>, <code>napi</code>. Alias: <code>-l</code>
</ParamField>
<ParamField path="--no-macros" type="boolean">
Disable macro execution in the bundler, transpiler and runtime
</ParamField>
<ParamField path="--jsx-factory" type="string">
Changes the function called when compiling JSX elements using the classic JSX runtime
</ParamField>
<ParamField path="--jsx-fragment" type="string">
Changes the function called when compiling JSX fragments
</ParamField>
<ParamField path="--jsx-import-source" type="string" default="react">
Declares the module specifier used to import the jsx and jsxs factory functions. Default: <code>react</code>
</ParamField>
<ParamField path="--jsx-runtime" type="string" default="automatic">
<code>automatic</code> (default) or <code>classic</code>
</ParamField>
<ParamField path="--jsx-side-effects" type="boolean">
Treat JSX elements as having side effects (disable pure annotations)
</ParamField>
<ParamField path="--ignore-dce-annotations" type="boolean">
Ignore tree-shaking annotations such as <code>@__PURE__</code>
</ParamField>
### Networking &amp; Security
<ParamField path="--port" type="number">
Set the default port for <code>Bun.serve</code>
</ParamField>
<ParamField path="--fetch-preconnect" type="string">
Preconnect to a URL while code is loading
</ParamField>
<ParamField path="--max-http-header-size" type="number" default="16384">
Set the maximum size of HTTP headers in bytes. Default is 16KiB
</ParamField>
<ParamField path="--dns-result-order" type="string" default="verbatim">
Set the default order of DNS lookup results. Valid orders: <code>verbatim</code> (default), <code>ipv4first</code>,{" "}
<code>ipv6first</code>
</ParamField>
<ParamField path="--use-system-ca" type="boolean">
Use the system's trusted certificate authorities
</ParamField>
<ParamField path="--use-openssl-ca" type="boolean">
Use OpenSSL's default CA store
</ParamField>
<ParamField path="--use-bundled-ca" type="boolean">
Use bundled CA store
</ParamField>
<ParamField path="--redis-preconnect" type="boolean">
Preconnect to <code>$REDIS_URL</code> at startup
</ParamField>
<ParamField path="--sql-preconnect" type="boolean">
Preconnect to PostgreSQL at startup
</ParamField>
<ParamField path="--user-agent" type="string">
Set the default User-Agent header for HTTP requests
</ParamField>
### Global Configuration &amp; Context
<ParamField path="--env-file" type="string">
Load environment variables from the specified file(s)
</ParamField>
<ParamField path="--cwd" type="string">
Absolute path to resolve files &amp; entrypoints from. This only changes the process' cwd
</ParamField>
<ParamField path="--config" type="string">
Specify path to Bun config file. Default <code>$cwd/bunfig.toml</code>. Alias: <code>-c</code>
</ParamField>
## Examples
Run a JavaScript or TypeScript file:
```bash
bun run ./index.js
bun run ./index.tsx
```
Run a package.json script:
```bash
bun run dev
bun run lint
```
+104
View File
@@ -0,0 +1,104 @@
# CLI Usage
```bash
bun test <patterns>
```
### Execution Control
<ParamField path="--timeout" type="number" default="5000">
Set the per-test timeout in milliseconds (default 5000)
</ParamField>
<ParamField path="--rerun-each" type="number">
Re-run each test file <code>NUMBER</code> times to help catch certain bugs
</ParamField>
<ParamField path="--retry" type="number">
Retry failed tests up to <code>NUMBER</code> times. Per-test <code>{`{ retry: N }`}</code> overrides this flag
</ParamField>
<ParamField path="--concurrent" type="boolean">
Treat all tests as <code>test.concurrent()</code> tests
</ParamField>
<ParamField path="--randomize" type="boolean">
Run tests in random order
</ParamField>
<ParamField path="--seed" type="number">
Set the random seed for test randomization
</ParamField>
<ParamField path="--bail" type="number">
Exit the test suite after <code>NUMBER</code> failures. If you do not specify a number, it defaults to 1.
</ParamField>
<ParamField path="--max-concurrency" type="number" default="20">
Maximum number of concurrent tests to execute at once (default 20)
</ParamField>
### Test Filtering
<ParamField path="--todo" type="boolean">
Include tests that are marked with <code>test.todo()</code>
</ParamField>
<ParamField path="--test-name-pattern" type="string">
Run only tests with a name that matches the given regex. Alias: <code>-t</code>
</ParamField>
### Reporting
<ParamField path="--reporter" type="string">
Test output reporter format. Available: <code>junit</code> (requires --reporter-outfile), <code>dots</code>. Default:
console output.
</ParamField>
<ParamField path="--reporter-outfile" type="string">
Output file path for the reporter format (required with --reporter=junit)
</ParamField>
<ParamField path="--dots" type="boolean">
Enable dots reporter. Shorthand for --reporter=dots
</ParamField>
### Coverage
<ParamField path="--coverage" type="boolean">
Generate a coverage profile
</ParamField>
<ParamField path="--coverage-reporter" type="string" default="text">
Report coverage in <code>text</code> and/or <code>lcov</code>. Defaults to <code>text</code>
</ParamField>
<ParamField path="--coverage-dir" type="string" default="coverage">
Directory for coverage files. Defaults to <code>coverage</code>
</ParamField>
### Snapshots
<ParamField path="--update-snapshots" type="boolean">
Update snapshot files. Alias: <code>-u</code>
</ParamField>
## Examples
Run all test files:
```bash terminal icon="terminal"
bun test
```
Run all test files with "foo" or "bar" in the file name:
```bash terminal icon="terminal"
bun test foo bar
```
Run all test files, only including tests whose name includes "baz":
```bash terminal icon="terminal"
bun test --test-name-pattern baz
```
+155
View File
@@ -0,0 +1,155 @@
## CLI Usage
```bash terminal icon="terminal"
bun update [<name>[@<version>] | <pattern>]...
bun up
```
### Update Strategy
<ParamField path="--force" type="boolean">
Always request the latest versions from the registry &amp; reinstall all dependencies. Alias: <code>-f</code>
</ParamField>
<ParamField path="--latest" type="boolean">
Update packages to their latest versions. Alias: <code>-L</code>
</ParamField>
### Dependency Scope
<ParamField path="--dev" type="boolean">
Only update <code>devDependencies</code>. Alias: <code>-D</code>
</ParamField>
<ParamField path="--prod" type="boolean">
Only update <code>dependencies</code> and <code>optionalDependencies</code>. Aliases: <code>-P</code>,{" "}
<code>--production</code>
</ParamField>
<ParamField path="--no-optional" type="boolean">
Don't update <code>optionalDependencies</code>
</ParamField>
<ParamField path="--global" type="boolean">
Install globally. Alias: <code>-g</code>
</ParamField>
<ParamField path="--omit" type="string">
Exclude <code>dev</code>, <code>optional</code>, or <code>peer</code> dependencies from install
</ParamField>
### Project File Management
<ParamField path="--yarn" type="boolean">
Write a <code>yarn.lock</code> file (yarn v1). Alias: <code>-y</code>
</ParamField>
<ParamField path="--no-save" type="boolean">
Don't update <code>package.json</code> or save a lockfile
</ParamField>
<ParamField path="--save" type="boolean" default="true">
Save to <code>package.json</code> (true by default)
</ParamField>
<ParamField path="--frozen-lockfile" type="boolean">
Disallow changes to lockfile
</ParamField>
<ParamField path="--save-text-lockfile" type="boolean">
Save a text-based lockfile
</ParamField>
<ParamField path="--lockfile-only" type="boolean">
Generate a lockfile without installing dependencies
</ParamField>
### Network & Registry
<ParamField path="--ca" type="string">
Provide a Certificate Authority signing certificate
</ParamField>
<ParamField path="--cafile" type="string">
Same as <code>--ca</code>, but as a file path to the certificate
</ParamField>
<ParamField path="--registry" type="string">
Use a specific registry by default, overriding <code>.npmrc</code>, <code>bunfig.toml</code> and environment variables
</ParamField>
<ParamField path="--network-concurrency" type="number" default="48">
Maximum number of concurrent network requests (default 48)
</ParamField>
### Caching
<ParamField path="--cache-dir" type="string">
Store &amp; load cached data from a specific directory path
</ParamField>
<ParamField path="--no-cache" type="boolean">
Ignore manifest cache entirely
</ParamField>
### Output & Logging
<ParamField path="--silent" type="boolean">
Don't log anything
</ParamField>
<ParamField path="--verbose" type="boolean">
Excessively verbose logging
</ParamField>
<ParamField path="--no-progress" type="boolean">
Disable the progress bar
</ParamField>
<ParamField path="--no-summary" type="boolean">
Don't print a summary
</ParamField>
### Script Execution
<ParamField path="--ignore-scripts" type="boolean">
Skip lifecycle scripts for all packages, including the project's <code>package.json</code> and trusted dependencies
</ParamField>
<ParamField path="--concurrent-scripts" type="number">
Maximum number of concurrent jobs for lifecycle scripts (default: 2x CPU cores)
</ParamField>
### Installation Controls
<ParamField path="--no-verify" type="boolean">
Skip verifying integrity of newly downloaded packages
</ParamField>
<ParamField path="--trust" type="boolean">
Add to <code>trustedDependencies</code> in the project's <code>package.json</code> and install the package(s)
</ParamField>
<ParamField path="--backend" type="string">
Platform-specific optimizations for installing dependencies. Possible values: <code>clonefile</code> (default on
macOS), <code>hardlink</code> (default on Linux and Windows), <code>symlink</code>, <code>copyfile</code>
</ParamField>
### General & Environment
<ParamField path="--config" type="string">
Specify path to config file (<code>bunfig.toml</code>). Alias: <code>-c</code>
</ParamField>
<ParamField path="--dry-run" type="boolean">
Resolve updates but don't install packages, update <code>package.json</code>, or save a lockfile (the project's own
lifecycle scripts still run)
</ParamField>
<ParamField path="--cwd" type="string">
Set a specific cwd
</ParamField>
<ParamField path="--help" type="boolean">
Print this help menu. Alias: <code>-h</code>
</ParamField>
+528
View File
@@ -0,0 +1,528 @@
export const GuidesList = () => {
const guidesData = {
hero: {
title: "Guides",
blurb: "A collection of code samples and walkthroughs for performing common tasks with Bun.",
},
featured: [
{
category: "Ecosystem",
title: "Use Tanstack Start with Bun",
href: "/guides/ecosystem/tanstack-start",
cta: "View guide",
},
{
category: "Ecosystem",
title: "Use Next.js with Bun",
href: "/guides/ecosystem/nextjs",
cta: "View guide",
},
{
category: "Ecosystem",
title: "Build a frontend using Vite and Bun",
href: "/guides/ecosystem/vite",
cta: "View guide",
},
{
category: "Runtime",
title: "Install TypeScript declarations for Bun",
href: "/guides/runtime/typescript",
cta: "View guide",
},
{
category: "HTTP",
title: "Write a simple HTTP server",
href: "/guides/http/simple",
cta: "View guide",
},
{
category: "WebSocket",
title: "Build a simple WebSocket server",
href: "/guides/websocket/simple",
cta: "View guide",
},
],
categories: [
{
key: "deployment",
title: "Deployment",
icon: "rocket",
items: [
{ title: "Deploy Bun on Vercel", href: "/guides/deployment/vercel" },
{ title: "Deploy Bun on Railway", href: "/guides/deployment/railway" },
{ title: "Deploy Bun on Render", href: "/guides/deployment/render" },
],
},
{
key: "binary",
title: "Binary data",
icon: "binary",
items: [
{
title: "Convert an ArrayBuffer to an array of numbers",
href: "/guides/binary/arraybuffer-to-array",
},
{ title: "Convert an ArrayBuffer to a Blob", href: "/guides/binary/arraybuffer-to-blob" },
{
title: "Convert an ArrayBuffer to a Buffer",
href: "/guides/binary/arraybuffer-to-buffer",
},
{
title: "Convert an ArrayBuffer to a string",
href: "/guides/binary/arraybuffer-to-string",
},
{
title: "Convert an ArrayBuffer to a Uint8Array",
href: "/guides/binary/arraybuffer-to-typedarray",
},
{ title: "Convert a Blob to an ArrayBuffer", href: "/guides/binary/blob-to-arraybuffer" },
{ title: "Convert a Blob to a DataView", href: "/guides/binary/blob-to-dataview" },
{ title: "Convert a Blob to a ReadableStream", href: "/guides/binary/blob-to-stream" },
{ title: "Convert a Blob to a string", href: "/guides/binary/blob-to-string" },
{ title: "Convert a Blob to a Uint8Array", href: "/guides/binary/blob-to-typedarray" },
{
title: "Convert a Buffer to an ArrayBuffer",
href: "/guides/binary/buffer-to-arraybuffer",
},
{ title: "Convert a Buffer to a blob", href: "/guides/binary/buffer-to-blob" },
{
title: "Convert a Buffer to a ReadableStream",
href: "/guides/binary/buffer-to-readablestream",
},
{ title: "Convert a Buffer to a string", href: "/guides/binary/buffer-to-string" },
{
title: "Convert a Buffer to a Uint8Array",
href: "/guides/binary/buffer-to-typedarray",
},
{ title: "Convert a DataView to a string", href: "/guides/binary/dataview-to-string" },
{
title: "Convert a Uint8Array to an ArrayBuffer",
href: "/guides/binary/typedarray-to-arraybuffer",
},
{ title: "Convert a Uint8Array to a Blob", href: "/guides/binary/typedarray-to-blob" },
{
title: "Convert a Uint8Array to a Buffer",
href: "/guides/binary/typedarray-to-buffer",
},
{
title: "Convert a Uint8Array to a DataView",
href: "/guides/binary/typedarray-to-dataview",
},
{
title: "Convert a Uint8Array to a ReadableStream",
href: "/guides/binary/typedarray-to-readablestream",
},
{
title: "Convert a Uint8Array to a string",
href: "/guides/binary/typedarray-to-string",
},
],
},
{
key: "ecosystem",
title: "Ecosystem",
icon: "puzzle",
items: [
{ title: "Use Gel with Bun", href: "/guides/ecosystem/gel" },
{ title: "Use Prisma ORM with Bun", href: "/guides/ecosystem/prisma" },
{ title: "Use Prisma Postgres with Bun", href: "/guides/ecosystem/prisma-postgres" },
{ title: "Create a Discord bot", href: "/guides/ecosystem/discordjs" },
{ title: "Add Sentry to a Bun app", href: "/guides/ecosystem/sentry" },
{ title: "Use Drizzle ORM with Bun", href: "/guides/ecosystem/drizzle" },
{ title: "Build a React app with Bun", href: "/guides/ecosystem/react" },
{ title: "Run Bun as a daemon with PM2", href: "/guides/ecosystem/pm2" },
{ title: "Build an app with Nuxt and Bun", href: "/guides/ecosystem/nuxt" },
{ title: "Build an app with Qwik and Bun", href: "/guides/ecosystem/qwik" },
{ title: "Build an app with Astro and Bun", href: "/guides/ecosystem/astro" },
{ title: "Build an app with Remix and Bun", href: "/guides/ecosystem/remix" },
{ title: "Use TanStack Start with Bun", href: "/guides/ecosystem/tanstack-start" },
{ title: "Run Bun as a daemon with systemd", href: "/guides/ecosystem/systemd" },
{ title: "Build an app with Next.js and Bun", href: "/guides/ecosystem/nextjs" },
{ title: "Build an app with SvelteKit and Bun", href: "/guides/ecosystem/sveltekit" },
{ title: "Build a frontend using Vite and Bun", href: "/guides/ecosystem/vite" },
{ title: "Build an app with SolidStart and Bun", href: "/guides/ecosystem/solidstart" },
{
title: "Use Neon Postgres through Drizzle ORM",
href: "/guides/ecosystem/neon-drizzle",
},
{ title: "Build an HTTP server using Hono and Bun", href: "/guides/ecosystem/hono" },
{
title: "Use Neon\'s Serverless Postgres with Bun",
href: "/guides/ecosystem/neon-serverless-postgres",
},
{ title: "Build an HTTP server using Elysia and Bun", href: "/guides/ecosystem/elysia" },
{ title: "Containerize a Bun application with Docker", href: "/guides/ecosystem/docker" },
{
title: "Build an HTTP server using Express and Bun",
href: "/guides/ecosystem/express",
},
{
title: "Server-side render (SSR) a React component",
href: "/guides/ecosystem/ssr-react",
},
{
title: "Read and write data to MongoDB using Mongoose and Bun",
href: "/guides/ecosystem/mongoose",
},
],
},
{
key: "htmlrewriter",
title: "HTMLRewriter",
icon: "file-code-2",
items: [
{
title: "Extract links from a webpage using HTMLRewriter",
href: "/guides/html-rewriter/extract-links",
},
{
title: "Extract social share images and Open Graph tags",
href: "/guides/html-rewriter/extract-social-meta",
},
],
},
{
key: "http",
title: "HTTP",
icon: "globe",
items: [
{ title: "Common HTTP server usage", href: "/guides/http/server" },
{ title: "Hot reload an HTTP server", href: "/guides/http/hot" },
{ title: "Write a simple HTTP server", href: "/guides/http/simple" },
{ title: "Start a cluster of HTTP servers", href: "/guides/http/cluster" },
{ title: "Configure TLS on an HTTP server", href: "/guides/http/tls" },
{ title: "Send an HTTP request using fetch", href: "/guides/http/fetch" },
{ title: "Proxy HTTP requests using fetch()", href: "/guides/http/proxy" },
{ title: "Stream a file as an HTTP Response", href: "/guides/http/stream-file" },
{ title: "Upload files via HTTP using FormData", href: "/guides/http/file-uploads" },
{ title: "fetch with unix domain sockets in Bun", href: "/guides/http/fetch-unix" },
{
title: "Streaming HTTP Server with Async Iterators",
href: "/guides/http/stream-iterator",
},
{
title: "Server-Sent Events (SSE)",
href: "/guides/http/sse",
},
{
title: "Streaming HTTP Server with Node.js Streams",
href: "/guides/http/stream-node-streams-in-bun",
},
],
},
{
key: "install",
title: "Package manager",
icon: "package",
items: [
{ title: "Add a dependency", href: "/guides/install/add" },
{ title: "Add a Git dependency", href: "/guides/install/add-git" },
{ title: "Add a peer dependency", href: "/guides/install/add-peer" },
{ title: "Add a tarball dependency", href: "/guides/install/add-tarball" },
{ title: "Add a trusted dependency", href: "/guides/install/trusted" },
{ title: "Add an optional dependency", href: "/guides/install/add-optional" },
{ title: "Add a development dependency", href: "/guides/install/add-dev" },
{
title: "Using bun install with Artifactory",
href: "/guides/install/jfrog-artifactory",
},
{ title: "Generate a yarn-compatible lockfile", href: "/guides/install/yarnlock" },
{
title: "Migrate from npm install to bun install",
href: "/guides/install/from-npm-install-to-bun-install",
},
{ title: "Configuring a monorepo using workspaces", href: "/guides/install/workspaces" },
{ title: "Install a package under a different name", href: "/guides/install/npm-alias" },
{
title: "Configure git to diff Bun\'s lockb lockfile",
href: "/guides/install/git-diff-bun-lockfile",
},
{
title: "Install dependencies with Bun in GitHub Actions",
href: "/guides/install/cicd",
},
{
title: "Override the default npm registry for bun install",
href: "/guides/install/custom-registry",
},
{
title: "Using bun install with an Azure Artifacts npm registry",
href: "/guides/install/azure-artifacts",
},
{
title: "Configure a private registry for an organization scope with bun install",
href: "/guides/install/registry-scope",
},
],
},
{
key: "processes",
title: "Processes",
icon: "cpu",
items: [
{ title: "Read from stdin", href: "/guides/process/stdin" },
{ title: "Listen for CTRL+C", href: "/guides/process/ctrl-c" },
{ title: "Listen to OS signals", href: "/guides/process/os-signals" },
{ title: "Spawn a child process", href: "/guides/process/spawn" },
{ title: "Parse command-line arguments", href: "/guides/process/argv" },
{ title: "Read stderr from a child process", href: "/guides/process/spawn-stderr" },
{ title: "Read stdout from a child process", href: "/guides/process/spawn-stdout" },
{ title: "Get the process uptime in nanoseconds", href: "/guides/process/nanoseconds" },
{ title: "Spawn a child process and communicate using IPC", href: "/guides/process/ipc" },
],
},
{
key: "read-file",
title: "Reading files",
icon: "file",
items: [
{ title: "Read a JSON file", href: "/guides/read-file/json" },
{ title: "Check if a file exists", href: "/guides/read-file/exists" },
{ title: "Read a file to a Buffer", href: "/guides/read-file/buffer" },
{ title: "Read a file as a string", href: "/guides/read-file/string" },
{ title: "Get the MIME type of a file", href: "/guides/read-file/mime" },
{ title: "Read a file to a Uint8Array", href: "/guides/read-file/uint8array" },
{ title: "Read a file to an ArrayBuffer", href: "/guides/read-file/arraybuffer" },
{ title: "Watch a directory for changes", href: "/guides/read-file/watch" },
{ title: "Read a file as a ReadableStream", href: "/guides/read-file/stream" },
],
},
{
key: "runtime",
title: "Runtime",
icon: "bot",
items: [
{ title: "Delete files", href: "/guides/runtime/delete-file" },
{ title: "Delete directories", href: "/guides/runtime/delete-directory" },
{ title: "Import a JSON file", href: "/guides/runtime/import-json" },
{ title: "Import a TOML file", href: "/guides/runtime/import-toml" },
{ title: "Import a YAML file", href: "/guides/runtime/import-yaml" },
{ title: "Run a Shell Command", href: "/guides/runtime/shell" },
{ title: "Re-map import paths", href: "/guides/runtime/tsconfig-paths" },
{ title: "Set a time zone in Bun", href: "/guides/runtime/timezone" },
{ title: "Set environment variables", href: "/guides/runtime/set-env" },
{ title: "Import a HTML file as text", href: "/guides/runtime/import-html" },
{ title: "Read environment variables", href: "/guides/runtime/read-env" },
{
title: "Build-time constants with --define",
href: "/guides/runtime/build-time-constants",
},
{ title: "Debugging Bun with the web debugger", href: "/guides/runtime/web-debugger" },
{ title: "Install and run Bun in GitHub Actions", href: "/guides/runtime/cicd" },
{ title: "Install TypeScript declarations for Bun", href: "/guides/runtime/typescript" },
{
title: "Debugging Bun with the VS Code extension",
href: "/guides/runtime/vscode-debugger",
},
{
title: "Inspect memory usage using V8 heap snapshots",
href: "/guides/runtime/heap-snapshot",
},
{
title: "Define and replace static globals & constants",
href: "/guides/runtime/define-constant",
},
{
title: "Codesign a single-file JavaScript executable on macOS",
href: "/guides/runtime/codesign-macos-executable",
},
],
},
{
key: "streams",
title: "Streams",
icon: "waves",
items: [
{ title: "Convert a ReadableStream to JSON", href: "/guides/streams/to-json" },
{
title: "Convert a Node.js Readable to JSON",
href: "/guides/streams/node-readable-to-json",
},
{ title: "Convert a ReadableStream to a Blob", href: "/guides/streams/to-blob" },
{
title: "Convert a Node.js Readable to a Blob",
href: "/guides/streams/node-readable-to-blob",
},
{ title: "Convert a ReadableStream to a Buffer", href: "/guides/streams/to-buffer" },
{ title: "Convert a ReadableStream to a string", href: "/guides/streams/to-string" },
{
title: "Convert a Node.js Readable to a string",
href: "/guides/streams/node-readable-to-string",
},
{
title: "Convert a ReadableStream to a Uint8Array",
href: "/guides/streams/to-typedarray",
},
{
title: "Convert a ReadableStream to an ArrayBuffer",
href: "/guides/streams/to-arraybuffer",
},
{
title: "Convert a Node.js Readable to an Uint8Array",
href: "/guides/streams/node-readable-to-uint8array",
},
{
title: "Convert a Node.js Readable to an ArrayBuffer",
href: "/guides/streams/node-readable-to-arraybuffer",
},
{
title: "Convert a ReadableStream to an array of chunks",
href: "/guides/streams/to-array",
},
],
},
{
key: "test",
title: "Test runner",
icon: "test-tube",
items: [
{ title: "Mock functions in bun test", href: "/guides/test/mock-functions" },
{ title: "Spy on methods in bun test", href: "/guides/test/spy-on" },
{ title: "Using Testing Library with Bun", href: "/guides/test/testing-library" },
{ title: "Update snapshots in bun test", href: "/guides/test/update-snapshots" },
{ title: "Run tests in watch mode with Bun", href: "/guides/test/watch-mode" },
{ title: "Use snapshot testing in bun test", href: "/guides/test/snapshot" },
{ title: "Bail early with the Bun test runner", href: "/guides/test/bail" },
{ title: "Skip tests with the Bun test runner", href: "/guides/test/skip-tests" },
{
title: "Migrate from Jest to Bun's test runner",
href: "/guides/test/migrate-from-jest",
},
{ title: "Run your tests with the Bun test runner", href: "/guides/test/run-tests" },
{ title: "Set the system time in Bun's test runner", href: "/guides/test/mock-clock" },
{
title: "Write browser DOM tests with Bun and happy-dom",
href: "/guides/test/happy-dom",
},
{
title: "Set a per-test timeout with the Bun test runner",
href: "/guides/test/timeout",
},
{
title: 'Mark a test as a "todo" with the Bun test runner',
href: "/guides/test/todo-tests",
},
{
title: "Re-run tests multiple times with the Bun test runner",
href: "/guides/test/rerun-each",
},
{
title: "Set a code coverage threshold with the Bun test runner",
href: "/guides/test/coverage-threshold",
},
{
title: "Selectively run tests concurrently with glob patterns",
href: "/guides/test/concurrent-test-glob",
},
{
title: "Generate code coverage reports with the Bun test runner",
href: "/guides/test/coverage",
},
{
title: "import, require, and test Svelte components with bun test",
href: "/guides/test/svelte-test",
},
],
},
{
key: "utilities",
title: "Utilities",
icon: "wrench",
items: [
{ title: "Hash a password", href: "/guides/util/hash-a-password" },
{ title: "Generate a UUID", href: "/guides/util/javascript-uuid" },
{ title: "Escape an HTML string", href: "/guides/util/escape-html" },
{ title: "Get the current Bun version", href: "/guides/util/version" },
{ title: "Encode and decode base64 strings", href: "/guides/util/base64" },
{ title: "Check if two objects are deeply equal", href: "/guides/util/deep-equals" },
{ title: "Detect when code is executed with Bun", href: "/guides/util/detect-bun" },
{ title: "Get the directory of the current file", href: "/guides/util/import-meta-dir" },
{ title: "Get the file name of the current file", href: "/guides/util/import-meta-file" },
{
title: "Convert a file URL to an absolute path",
href: "/guides/util/file-url-to-path",
},
{ title: "Compress and decompress data with gzip", href: "/guides/util/gzip" },
{
title: "Convert an absolute path to a file URL",
href: "/guides/util/path-to-file-url",
},
{
title: "Get the path to an executable bin file",
href: "/guides/util/which-path-to-executable-bin",
},
{ title: "Sleep for a fixed number of milliseconds", href: "/guides/util/sleep" },
{ title: "Compress and decompress data with DEFLATE", href: "/guides/util/deflate" },
{
title: "Get the absolute path of the current file",
href: "/guides/util/import-meta-path",
},
{ title: "Check if the current file is the entrypoint", href: "/guides/util/entrypoint" },
{ title: "Get the absolute path to the current entrypoint", href: "/guides/util/main" },
],
},
{
key: "websocket",
title: "WebSocket",
icon: "radio",
items: [
{ title: "Build a simple WebSocket server", href: "/guides/websocket/simple" },
{
title: "Enable compression for WebSocket messages",
href: "/guides/websocket/compression",
},
{ title: "Build a publish-subscribe WebSocket server", href: "/guides/websocket/pubsub" },
{
title: "Set per-socket contextual data on a WebSocket",
href: "/guides/websocket/context",
},
],
},
{
key: "write-file",
title: "Writing files",
icon: "file-pen",
items: [
{ title: "Delete a file", href: "/guides/write-file/unlink" },
{ title: "Write to stdout", href: "/guides/write-file/stdout" },
{ title: "Write a Blob to a file", href: "/guides/write-file/blob" },
{ title: "Write a file to stdout", href: "/guides/write-file/cat" },
{ title: "Append content to a file", href: "/guides/write-file/append" },
{ title: "Write a string to a file", href: "/guides/write-file/basic" },
{ title: "Write a file incrementally", href: "/guides/write-file/filesink" },
{ title: "Write a Response to a file", href: "/guides/write-file/response" },
{ title: "Copy a file to another location", href: "/guides/write-file/file-cp" },
{ title: "Write a ReadableStream to a file", href: "/guides/write-file/stream" },
],
},
],
};
return (
<div id="guides-list">
{/* Featured cards */}
<div className="mb-12">
<h2 className="text-2xl font-bold mb-6">Featured</h2>
<Columns cols={3}>
{guidesData.featured.map(g => (
<Card key={g.href} title={g.title} href={g.href} cta={g.cta} />
))}
</Columns>
</div>
{/* All guides organized by category */}
<div className="mb-8">
<h2 className="text-2xl font-bold mb-6">All Guides</h2>
{guidesData.categories.map(category => (
<div key={category.key} className="mb-8">
<h3 className="text-xl font-semibold mb-4 flex items-center gap-2">{category.title}</h3>
<Columns cols={3}>
{category.items.map(guide => (
<Card key={guide.href} title={guide.title} description=" " href={guide.href} cta="" />
))}
</Columns>
</div>
))}
</div>
</div>
);
};