26 lines
418 B
Plaintext
26 lines
418 B
Plaintext
---
|
|||
|
|
title: Install a package under a different name
|
||
|
|
sidebarTitle: Install with alias
|
||
|
|
mode: center
|
||
|
|
---
|
||
|
|
|
||
|
|
To install an npm package under an alias:
|
||
|
|
|
||
|
|
```sh terminal icon="terminal"
|
||
|
|
bun add my-custom-name@npm:zod
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
You can now import the `zod` package as `my-custom-name`.
|
||
|
|
|
||
|
|
```ts index.ts icon="/icons/typescript.svg"
|
||
|
|
import { z } from "my-custom-name";
|
||
|
|
|
||
|
|
z.string();
|
||
|
|
```
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
See [`bun install`](/pm/cli/install).
|