skills/bun-index/SKILL.md
Bun is an all-in-one toolkit for developing modern JavaScript/TypeScript applications.
npx skillsauth add jarle/bun-skills Bun Welcome to BunInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
<CardGroup> <Card icon="cog" title="Bun Runtime" href="/runtime" cta={ <span> Get started with <code>bun run</code> </span> } > A fast JavaScript runtime designed as a drop-in replacement for Node.js </Card>Bun is an all-in-one toolkit for developing modern JavaScript/TypeScript applications.
<Card icon="box" title="Bun Package Manager" href="/pm/cli/install" cta={ <span> Get started with <code>bun install</code> </span> }
Install packages up to 30x faster than npm with a global cache and workspaces
</Card>
<Card icon="flask-conical" title="Bun Test Runner" href="/test" cta={ <span> Get started with <code>bun test</code> </span> }
Jest-compatible, TypeScript-first tests with snapshots, DOM, and watch mode
</Card>
<Card icon="combine" title="Bun Bundler" href="/bundler" cta={ <span> Get started with <code>bun build</code> </span> }
Bundle TypeScript, JSX, React & CSS for both browsers and servers
</Card>
</CardGroup>
Bun ships as a single, dependency-free binary and includes a runtime, package manager, test runner, and bundler. New to Bun?
<CardGroup> <Card icon="download" title="Install Bun" href="/installation"> Supported platforms and all install methods. </Card> <Card icon="zap" title="Quickstart" href="/quickstart"> Hello world in minutes with Bun.serve. </Card> </CardGroup>bun install.Explore each area using the cards above. Each section is structured with an overview, quick examples, reference, and best practices for fast scanning and deep dives.
Bun is an all-in-one toolkit for JavaScript and TypeScript apps. It ships as a single executable called bun.
At its core is the Bun runtime, a fast JavaScript runtime designed as a drop-in replacement for Node.js. It's written in Zig and powered by JavaScriptCore under the hood, dramatically reducing startup times and memory usage.
bun run index.tsx # TS and JSX supported out of the box
The bun command-line tool also implements a test runner, script runner, and Node.js-compatible package manager, all significantly faster than existing tools and usable in existing Node.js projects with little to no changes necessary.
bun run start # run the `start` script
bun install <pkg> # install a package
bun build ./index.tsx # bundle a project for browsers
bun test # run tests
bunx cowsay 'Hello, world!' # execute a package
JavaScript (or, more formally, ECMAScript) is just a specification for a programming language. Anyone can write a JavaScript engine that ingests a valid JavaScript program and executes it. The two most popular engines in use today are V8 (developed by Google) and JavaScriptCore (developed by Apple). Both are open source.
But most JavaScript programs don't run in a vacuum. They need a way to access the outside world to perform useful tasks. This is where runtimes come in. They implement additional APIs that are then made available to the JavaScript programs they execute.
Notably, browsers ship with JavaScript runtimes that implement a set of Web-specific APIs that are exposed via the global window object. Any JavaScript code executed by the browser can use these APIs to implement interactive or dynamic behavior in the context of the current webpage.
Similarly, Node.js is a JavaScript runtime that can be used in non-browser environments, like servers. JavaScript programs executed by Node.js have access to a set of Node.js-specific globals like Buffer, process, and __dirname in addition to built-in modules for performing OS-level tasks like reading/writing files (node:fs) and networking (node:net, node:http). Node.js also implements a CommonJS-based module system and resolution algorithm that pre-dates JavaScript's native module system.
Bun is designed as a faster, leaner, more modern replacement for Node.js.
Bun is designed from the ground-up with today's JavaScript ecosystem in mind.
.jsx, .ts, and .tsx files; Bun's transpiler converts these to vanilla JavaScript before execution.fetch, WebSocket, and ReadableStream. Bun is powered by the JavaScriptCore engine, which is developed by Apple for Safari, so some APIs like Headers and URL directly use Safari's implementation.process, Buffer) and modules (path, fs, http, etc.) This is an ongoing effort that is not complete. Refer to the compatibility page for the current status.Bun is more than a runtime. The long-term goal is to be a cohesive, infrastructural toolkit for building apps with JavaScript/TypeScript, including a package manager, transpiler, bundler, script runner, test runner, and more.
development
Using TypeScript with Bun, including type definitions and compiler options
development
Learn how to write tests using Bun's Jest-compatible API with support for async tests, timeouts, and various test modifiers
testing
Learn how to use snapshot testing in Bun to save and compare output between test runs
testing
Learn about Bun test's runtime integration, environment variables, timeouts, and error handling