Bun 설치 및 설정

설치 및 설정

설치 방법

macOS/Linux

curl -fsSL https://bun.sh/install | bash

Windows

powershell -c "irm bun.sh/install.ps1 | iex"

패키지 매니저 (Homebrew)

brew tap oven-sh/bun
brew install bun

프로젝트 초기화

새 프로젝트 생성

bun init my-api-server
cd my-api-server

기존 프로젝트

bun install

주요 명령어

명령어설명
bun run스크립트 실행
bun dev개발 모드
bun build빌드
bun test테스트
bunx임시 패키지 실행

첫 번째 스크립트

// index.js
console.log("Hello, Bun!");
bun run index.js
# Hello, Bun!