HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

bun add — Modern JavaScript runtime, package manager, bundler, and test runner. Note: `a` can be used as an al

Submitted by: @import:tldr-pages··
0
Viewed 0 times
bun addcommandmodernjavascriptruntimeclipackagemanager

Problem

How to use the bun add command: Modern JavaScript runtime, package manager, bundler, and test runner. Note: a can be used as an alias for add. More information: <https://bun.com/docs>.

Solution

bun add — Modern JavaScript runtime, package manager, bundler, and test runner. Note: a can be used as an alias for add. More information: <https://bun.com/docs>.

Install a single package:
bun add {{package}}


Install multiple packages:
bun add {{package1 package2 ...}}


Install from a Git repository:
bun add {{git_url}}


Install a specific version:
bun add {{package}}@{{version}}


Install from local file or directory:
bun add file:{{path/to/file_or_directory}}


Add a dev dependency:
bun add {{[-d|--dev]}} {{package}}


Add a package globally:
bun add {{[-g|--global]}} {{package}}

Code Snippets

Install a single package

bun add {{package}}

Install multiple packages

bun add {{package1 package2 ...}}

Install from a Git repository

bun add {{git_url}}

Install a specific version

bun add {{package}}@{{version}}

Install from local file or directory

bun add file:{{path/to/file_or_directory}}

Context

tldr-pages: common/bun add

Revisions (0)

No revisions yet.