Bun Add a tarball dependency

Add a tarball dependency

jarle Updated

File contents

Add a tarball dependency

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

Running this command will download, extract, and install the tarball to your project's node_modules directory. It will also add the following line to your package.json:

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

The package "zod" can now be imported as usual.

import { z } from "zod";

See Docs > Package manager for complete documentation of Bun's package manager.

jarle/bun-skills/tree/main/skills/bun-guides-install-add-tarball commit e42e044cf0

Frequently asked questions

npx skillmds@latest add jarle/bun-add-a-tarball-dependency