From deeed5ec0bdeacacda3145c16c30b00db5816586 Mon Sep 17 00:00:00 2001 From: h7ml Date: Tue, 25 Jun 2024 04:20:29 +0800 Subject: [PATCH] feat: add bun (#671) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Create a Bun备忘清单 in markdown format to document the common commands for the Bun package manager, comparing it to npm and Yarn. This includes installation, project creation, dependency management, script execution, and cache handling. --- docs/bun.md | 180 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 docs/bun.md diff --git a/docs/bun.md b/docs/bun.md new file mode 100644 index 0000000..14e5d21 --- /dev/null +++ b/docs/bun.md @@ -0,0 +1,180 @@ +Bun 备忘清单 +=== + +这是一份 [`Bun`](https://bun.sh/) 软件包管理器备忘单,其中列出了 `Bun` 常用命令使用清单 + +入门 +--- + +### 安装 Bun + +```bash +curl -fsSL https://bun.sh/install | bash +``` + +### Bun 与 npm/Yarn 命令比较 + +npm/Yarn | Bun | 说明 +:- | :- | :- +`npm install`, `yarn add` | `bun add` | 安装依赖 +`npm init`, `yarn init` | `bun init` | 创建 `package.json` 文件 +`npm install -g`, `yarn global add` | `bun global add` | 全局安装包 +`npm run`, `yarn run` | `bun run` | 运行脚本 +`npm uninstall`, `yarn remove` | `bun remove` | 移除包 +`npm update`, `yarn upgrade` | `bun upgrade` | 更新包 +`npm cache clean`, `yarn cache clean` | `bun cache clean` | 清理缓存目录 + +### 创建项目 + +```bash +bun create