Runtime
Bundler
Package Manager
Test Runner
Guides
Reference
Blog
Install Bun
Guides Package Manager

Add a Git dependency

Bun supports directly adding GitHub repositories as dependencies of your project.

terminal
$ bun add github:lodash/lodash

This adds the following line to your package.json:

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

Bun supports a number of protocols for specifying Git dependencies.

terminal
$ 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

When possible, Bun downloads GitHub dependencies as HTTP tarballs, which is faster.


See bun install.

On this page

No Headings