Communitygithub.com

Bun 런타임

Bun을 런타임, 패키지 매니저, 번들러 및 테스트 러너로 사용합니다. Bun과 Node 중 선택하는 기준, 마이그레이션 참고 사항, Vercel 지원 정보를 제공합니다.

Bun 런타임란 무엇인가요?

이 스킬은 개발자가 Bun을 JavaScript 및 TypeScript 프로젝트의 올인원 도구로 활용할 수 있도록 지원합니다. Bun은 JavaScriptCore 엔진 위에 Zig로 구현된 드롭인 Node 호환 런타임으로, `bun install`은 npm/yarn보다 훨씬 빠르며, `bun.lock`(텍스트) 잠금 파일을 생성합니다. 또한 내장 번들러와 `bun test`(Jest 유사 API)를 제공하여 단일 도구 체인으로 실행, 설치, 테스트, 빌드를 모두 처리할 수 있습니다. Node에서 마이그레이션할 때는 `node script.js`를 `bun run script.js` 또는 `bun script.js`로 바꾸고, `npm install` 대신 `bun install`을 사용하면 대부분의 패키지가 그대로 동작합니다. Vercel 배포 시 프로젝트 설정에서 런타임을 Bun으로 지정하고, `bun run build` 또는 `bun build`로 빌드하며, 재현 가능한 배포를 위해 `bun install --frozen-lockfile`을 사용합니다. 이 스킬은 CLI 명령어, `bun:test` 임포트 예제, `Bun.file()` 및 `Bun.serve()` 같은 런타임 API 사용법도 포함하여 실무적인 가이드를 제공합니다.

지원 대상~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/affaan-m/everything-claude-code/tree/main/skills/bun-runtime

즐겨 사용하는 AI에게 물어보기

이 에이전트 스킬이 미리 로드된 새 채팅을 엽니다.

문서

Bun 런타임은(는) 무엇을 하나요?

Bun은 빠른 올인원 JavaScript 런타임이자 도구 키트입니다: 런타임, 패키지 매니저, 번들러, 테스트 러너.

사용 시기

  • Bun을 선호하는 경우: 새로운 JS/TS 프로젝트, 설치/실행 속도가 중요한 스크립트, Bun 런타임을 사용한 Vercel 배포, 단일 도구 체인(실행 + 설치 + 테스트 + 빌드)을 원할 때.
  • Node를 선호하는 경우: 최대 생태계 호환성, Node를 가정하는 레거시 도구, 또는 의존성이 Bun에서 알려진 문제가 있을 때.

다음과 같은 상황에서 사용하세요: Bun 도입 시, Node에서 마이그레이션 시, Bun 스크립트/테스트를 작성하거나 디버깅할 때, Vercel 또는 다른 플랫폼에서 Bun을 구성할 때.

작동 방식

  • 런타임: 드롭인 Node 호환 런타임(Zig으로 구현, JavaScriptCore 기반).
  • 패키지 매니저: bun install은 npm/yarn보다 훨씬 빠릅니다. 현재 Bun에서는 잠금 파일이 기본적으로 bun.lock(텍스트)입니다; 이전 버전은 bun.lockb(바이너리)를 사용했습니다.
  • 번들러: 앱 및 라이브러리용 내장 번들러 및 트랜스파일러.
  • 테스트 러너: Jest 유사 API를 사용하는 내장 bun test.

Node에서 마이그레이션: node script.js를 bun run script.js 또는 bun script.js로 바꾸세요. npm install 대신 bun install을 실행하세요; 대부분의 패키지가 동작합니다. npm 스크립트에는 bun run을 사용하고, npx 방식의 일회성 실행에는 bun x를 사용하세요. Node 내장 모듈이 지원되며, 성능 향상을 위해 Bun API가 존재하는 경우 이를 선호하세요.

Vercel: 프로젝트 설정에서 런타임을 Bun으로 설정하세요. 빌드: bun run build 또는 bun build ./src/index.ts --outdir=dist. 설치: 재현 가능한 배포를 위해 bun install --frozen-lockfile.

예제

실행 및 설치

# 의존성 설치 (bun.lock 또는 bun.lockb 생성/업데이트)
bun install

# 스크립트 또는 파일 실행
bun run dev
bun run src/index.ts
bun src/index.ts

스크립트 및 환경변수

bun run --env-file=.env dev
FOO=bar bun run script.ts

테스트

bun test
bun test --watch
// test/example.test.ts
import { expect, test } from "bun:test";

test("add", () => {
  expect(1 + 2).toBe(3);
});

런타임 API

const file = Bun.file("package.json");
const json = await file.json();

Bun.serve({
  port: 3000,
  fetch(req) {
    return new Response("Hello");
  },
});

모범 사례

  • 재현 가능한 설치를 위해 잠금 파일(bun.lock 또는 bun.lockb)을 커밋하세요.
  • 스크립트에는 bun run을 선호하세요. TypeScript의 경우 Bun이 .ts 파일을 기본적으로 실행합니다.
  • 의존성을 최신 상태로 유지하세요; Bun과 생태계가 빠르게 진화합니다.

Individual skills in this repo

This repo contains 20 individual skills — each has its own dedicated page.

accessibility

Design, implement, and audit inclusive digital products using WCAG 2.2 Level AA. Use when building or auditing UI that must meet WCAG 2.2 Level AA, or when reviewing a change for keyboard, contrast, or screen-reader support.

affaan-m/claude-api

Anthropic Claude API patterns for Python and TypeScript. Covers Messages API, streaming, tool use, vision, extended thinking, batches, prompt caching, and Claude Agent SDK. Use when building applications with the Claude API or Anthropic SDKs.

affaan-m/everything-claude-code

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/everything-claude-code

End-to-end marketing campaign planning and execution. Covers audience research, positioning, campaign angle definition, landing page copy, email sequences, social posts, ad copy, short-form video scripts, and content calendars. Use as the orchestration layer for multi-channel product launches. Use when planning or executing a multi-channel product launch, or producing landing page, email, social, or ad copy.

affaan-m/everything-claude-code-conventions

Development conventions and patterns for everything-claude-code. JavaScript project with conventional commits.

affaan-m/frontend-design

Create distinctive, production-grade frontend interfaces with high design quality. Use when the user asks to build web components, pages, or applications and the visual direction matters as much as the code quality.

affaan-m/gget

gget CLI and Python workflow for quick genomic database queries, sequence lookup, BLAST-style searches, enrichment checks, and reproducible bioinformatics evidence logs.

affaan-m/literature-review

Systematic literature-review workflow for academic, biomedical, technical, and scientific topics, including search planning, source screening, synthesis, citation checks, and evidence logging.

affaan-m/motion-ui

Production-ready UI motion system for React/Next.js. Use when implementing animations, transitions, or motion patterns.

affaan-m/project-guidelines-example

Example project-specific skill template based on a real production application.

affaan-m/pubmed-database

Direct PubMed and NCBI E-utilities search workflows for biomedical literature, MeSH queries, PMID lookup, citation retrieval, and API-backed literature monitoring.

affaan-m/scholar-evaluation

Structured scholarly-work evaluation for papers, proposals, literature reviews, methods sections, evidence quality, citation support, and research-writing feedback.

affaan-m/uspto-database

USPTO patent and trademark data workflow for official record lookup, PatentSearch queries, TSDR checks, assignment data, and reproducible IP research logs.

agent-architecture-audit

Full-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack.

agent-eval

Head-to-head comparison of coding agents (Claude Code, Aider, Codex, etc.) on custom tasks with pass rate, cost, time, and consistency metrics. Use when choosing between coding agents, or when a change to an agent setup needs measured pass rate, cost, and time rather than an impression.

agent-harness-construction

Design and optimize AI agent action spaces, tool definitions, and observation formatting for higher completion rates. Use when defining or revising an agent

agentic-engineering

Operate as an agentic engineer using eval-first execution, decomposition, and cost-aware model routing. Use when planning or executing engineering work that agents will carry out end to end.

agentic-os

Build persistent multi-agent operating systems on Claude Code. Covers kernel architecture, specialist agents, slash commands, file-based memory, scheduled automation, and state management without external databases. Use when building a persistent multi-agent system on Claude Code with its own memory, commands, and scheduling.

agent-introspection-debugging

Structured self-debugging workflow for AI agent failures using capture, diagnosis, contained recovery, and introspection reports. Use when an agent run fails and you need a reproducible diagnosis instead of a retry.

agent-payment-x402

Add x402 payment execution to AI agents with per-task budgets, spending controls, and non-custodial wallets. Supports Base through agentwallet-sdk and X Layer through OKX Payments / OKX Agent Payments Protocol. Use when an agent must pay for something itself and needs per-task budgets, spending controls, and a non-custodial wallet.

관련 스킬