---
name: ecc-bun-runtime
description: Bun as runtime, package manager, bundler, and test runner. When to choose Bun vs Node, migration notes, and platform support.
---

# Bun Runtime

Bun as runtime, package manager, bundler, and test runner.

## When to Use
- Starting a new JS/TS project
- Migrating from Node to Bun
- Deciding between Bun and Node

## When to Choose Bun
- New projects where Bun's built-in bundler, test runner, and TS support simplify setup
- Scripts/lambdas where startup speed matters
- Projects that need a single tool for runtime + test + bundler

## When to Stick with Node
- Projects depending on native Node addons (node-gyp)
- Projects requiring long-term stability and ecosystem maturity
- Deploying to platforms without Bun support (some serverless providers)

## Migration from Node
- `bun run script.ts` instead of `node script.js`
- `bun add` instead of `npm install`
- `bun test` instead of `jest/vitest`
- `bun build` instead of `esbuild/webpack`

## Key Differences from Node
- Built-in TypeScript support (no ts-node/tsx needed)
- Built-in test runner (Jest-compatible API)
- Built-in bundler
- 3-5x faster package installs
- SQLite built-in (bun:sqlite)

## Platform Support
- Linux, macOS, Windows (partial)
- Railway, Fly.io, Vercel (limited)
- Docker images available
