tldr/pages.zh/common/bun.md

38 lines
641 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# bun
> JavaScript 运行时和工具箱。
> 包含打包工具、测试运行器和包管理器。
> 更多信息:<https://bun.sh>.
- 运行 JavaScript 文件或 `package.json` 脚本:
`bun run {{path/to/file|script_name}}`
- 运行单元测试:
`bun test`
- 下载并安装 `package.json` 中列为依赖项的包:
`bun install`
-`package.json` 添加依赖:
`bun add {{模块名称}}`
-`package.json` 删除依赖:
`bun remove {{模块名称}}`
- 在当前文件夹创建新的 Bun 项目:
`bun init`
- 启动 REPL交互式 shell
`bun repl`
- 升级 Bun 到最新版本:
`bun upgrade`