diff options
Diffstat (limited to 'docs/guides/install/npm-alias.md')
-rw-r--r-- | docs/guides/install/npm-alias.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/docs/guides/install/npm-alias.md b/docs/guides/install/npm-alias.md new file mode 100644 index 000000000..0b38d8c71 --- /dev/null +++ b/docs/guides/install/npm-alias.md @@ -0,0 +1,23 @@ +--- +name: Install a package under a different name +--- + +To install an npm package under an alias: + +```sh +$ bun add my-custom-name@npm:zod +``` + +--- + +The `zod` package can now be imported as `my-custom-name`. + +```ts +import { z } from "my-custom-name"; + +z.string(); +``` + +--- + +See [Docs > Package manager](/docs/cli/install) for complete documentation of Bun's package manager. |