Bun 支援直接將 GitHub 儲存庫新增為專案的依賴項。
bun add github:lodash/lodash
這會將以下程式碼行新增至您的 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 套件管理器的完整文件。