mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
36 lines
813 B
Plaintext
36 lines
813 B
Plaintext
---
|
|
title: Add a tarball dependency
|
|
sidebarTitle: Add a tarball dependency
|
|
mode: center
|
|
---
|
|
|
|
Bun's package manager can install any publicly available tarball URL as a dependency of your project.
|
|
|
|
```sh terminal icon="terminal"
|
|
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`:
|
|
|
|
```json package.json icon="file-json"
|
|
{
|
|
"dependencies": {
|
|
"zod": "https://registry.npmjs.org/zod/-/zod-3.21.4.tgz" // [!code ++]
|
|
}
|
|
}
|
|
```
|
|
|
|
---
|
|
|
|
The package `"zod"` can now be imported as usual.
|
|
|
|
```ts
|
|
import { z } from "zod";
|
|
```
|
|
|
|
---
|
|
|
|
See [Docs > Package manager](/pm/cli/install) for complete documentation of Bun's package manager.
|