PACKAGE · PACKAGE MANAGER

bun

Bun is a fast all-in-one JavaScript runtime.

WEEKLY DOWNLOADS 1.1M
STARS 92.9K
FORKS 4.7K
OPEN ISSUES 7.0K
INSTALL SIZE 362.5 MB
UNPACKED SIZE 20.8 kB
LAST UPDATED 3mo ago
DOWNLOAD TRENDS

bun downloads — last 12 months

Download trends for bun1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.01.8M3.7M5.5M7.3MJun 2025SepDecMarMay 2026
bun
ABOUT BUN

Bun is a highly optimized, all-inclusive JavaScript runtime designed for speed and developer experience. It addresses the complexity and performance bottlenecks often encountered with traditional JavaScript tooling by providing a single, cohesive environment for running, bundling, transpiling, and testing code. This runtime leverages the JavaScriptCore engine, offering an alternative to Node.js that prioritizes raw execution speed and reduced boilerplate.

Bun's core philosophy centers around simplicity and performance, aiming to be a drop-in replacement for existing Node.js workflows while significantly outperforming them in benchmarks. It is built with developers in mind, offering features like built-in TypeScript and JSX support, a fast bundler, and an integrated test runner, reducing the need for multiple external dependencies. The primary audience includes developers seeking faster build times, quicker script execution, and a streamlined development setup.

Key API patterns in Bun revolve around its command-line interface, such as `bun run`, `bun build`, and `bun test`, which mirror and often improve upon their npm script counterparts. It also exposes low-level APIs for custom bundler plugins and HTTP server creation via the `Bun.serve` function, enabling fine-grained control. The runtime's design emphasizes minimal configuration and sensible defaults, making common tasks straightforward.

Bun integrates seamlessly into existing JavaScript and TypeScript ecosystems. It handles common frontend tooling needs like bundling React and other frameworks, and it supports TypeScript out of the box without requiring separate compilation steps for development. Its compatibility with many Node.js APIs allows for easier migration of existing projects.

Bun boasts impressive performance characteristics, largely due to its implementation in Zig and its use of the JavaScriptCore engine, which are inherently fast. The package size is remarkably small at 20.8 kB unpacked, contributing to quick installation times, although it's crucial to note that the primary distribution mechanism is via the official `bun.sh` installer, not typically through npm downloads, whose 1.6M weekly downloads do not reflect actual usage. This rapid execution speed extends to its bundler and test runner capabilities.

Developers should be aware that while Bun aims for Node.js compatibility, edge cases may exist where certain native Node.js modules or specific npm packages might not function identically or at all, especially those relying on C++ addons. The project is mature but still actively developed, with its 6.9K open issues indicating ongoing feature development and bug resolution. Its reliance on the JavaScriptCore engine also means behaviors might occasionally differ from V8-based runtimes.

WHEN TO USE
  • When aiming for faster local development server startup and hot module replacement.
  • When optimizing build pipelines for React, Preact, or SolidJS projects using its integrated bundler.
  • When migrating TypeScript projects and seeking to eliminate the need for separate compilation steps during development.
  • When writing performance-critical server-side logic that benefits from a faster JavaScript engine.
  • When developing CLI tools and wanting a single binary for execution, bundling, and testing.
  • When leveraging its `Bun.serve` API for building efficient HTTP servers and WebSockets with minimal overhead.
WHEN NOT TO USE
  • If your project heavily relies on a specific Node.js native module that has no Bun equivalent or known compatibility issues.
  • When the ecosystem predictability of a V8-based runtime is a primary requirement, and adherence to Node.js core behaviors is paramount.
  • If you require extensive third-party Node.js native addons that are not yet supported or tested within the Bun environment.
  • For projects where the stability of long-term, established tooling chains is more critical than incremental performance gains.
  • When integrating deeply with specific CI/CD systems that have strict binary requirements tied exclusively to Node.js.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 6
bun vs deno ★ 107.0K · 37.7K/wk bun vs ts-node ★ 13.1K · 20.9M/wk bun vs yarn ★ 41.5K · 4.1M/wk bun vs npm ★ 9.8K · 6.6M/wk bun vs pnpm ★ 35.4K · 52.2M/wk bun vs node ★ 165 · 378.2K/wk