using-bun
0
总安装量
1
周安装量
安装命令
npx skills add https://github.com/pauloviccs/viccs_antigravity_skillscreator --skill using-bun
Agent 安装分布
amp
1
cline
1
openclaw
1
trae
1
opencode
1
cursor
1
Skill 文档
Using Bun
When to use this skill
- When the user explicitly mentions “Bun”.
- When the user wants to run TypeScript files directly without compilation.
- When the user wants faster package installation (replacing npm/yarn).
- When the user needs a fast test runner or bundler.
- When the user wants to use native APIs like
Bun.serve,Bun.file,Bun.write.
Workflow
- Verify Installation: Check if Bun is available.
bun --version
- Initialize Project (if new):
bun init
- Manage Dependencies:
- Install:
bun install(replacesnpm install) - Add:
bun add <package>(replacesnpm install <package>) - Remove:
bun remove <package>
- Install:
- Run Scripts/Files:
- Run file:
bun <file.ts/js>(e.g.,bun index.ts) - Run script:
bun run <script-name> - Watch mode:
bun --hot <file.ts>
- Run file:
- Testing:
- Run tests:
bun test
- Run tests:
- Building:
- Bundle:
bun build ./entry.ts --outdir ./out
- Bundle:
Instructions
- Runtime: Bun runs
.tsand.tsxfiles directly. Notscneeded for execution. - Package Manager: Use
bun installinstead ofnpm install. It readspackage.jsonand writes tobun.lockb(binary lockfile). - Test Runner:
bun testis a drop-in replacement for Jest. It supportsdescribe,test,expectautomatically. - Environment Variables: Bun reads
.envfiles automatically. Access viaprocess.envorBun.env. - Shell: Use
Bun.$for cross-platform shell scripting in JavaScript files.