Skip to content
NewBun 1.4.5 is out. Release notes
AphrodyBun

Guides · Package Manager

Add a tarball dependency

Install a package from a publicly available tarball URL with bun add.

Bun's package manager can install any publicly available tarball URL as a dependency of your project.

bun add zod@https://registry.npmjs.org/zod/-/zod-3.21.4.tgz

This command downloads, extracts, and installs the tarball into your project's node_modules directory, and adds the following line to your package.json:

package.json
{
  "dependencies": {
    "zod": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz" // [!code ++]
  }
}

You can now import zod as usual.

import { z } from "zod";

See bun install.