Bun

指南套件管理員

使用 Bun 新增 Git 相依性

Bun 支援直接將 GitHub 存放庫新增為專案的相依性。

bun add github:lodash/lodash

這會將下列程式碼行新增至您的 package.json

package.json
{
  "dependencies": {
    "lodash": "github:lodash/lodash"
  }
}

Bun 支援多種協定來指定 Git 相依性。

bun add git+https://github.com/lodash/lodash.git
bun add git+ssh://github.com/lodash/lodash.git#4.17.21
bun add git@github.com:lodash/lodash.git
bun add github:colinhacks/zod

請參閱 文件 > 套件管理員 以取得 Bun 套件管理員的完整文件。