Overview
Bun is a fast all-in-one JavaScript runtime that includes a bundler, transpiler, package manager, and test runner. It is designed to be a complete toolkit for JavaScript and TypeScript development, offering significant performance improvements over existing tools.
Bun is built with the goal of providing an integrated development experience, combining multiple tools into a single package.
Installation
There are multiple ways to install Bun. In this guide, we will show the three easiest methods for installing Bun. You can find information on other methods here.
Usage
Initializing a Project
This command initializes a new project and creates a bun.lockb file along with a package.json file.
Installing a Package
This command installs a package locally in your project and updates the package.json and bun.lockb files.
Example
This installs the axios package, a promise-based HTTP client for the browser and Node.js.
Updating a Package
This command updates a package to the latest version. If no package name is specified, it updates all project dependencies.
Example
This updates the axios package to its latest version.
Uninstalling a Package
This command removes a package from your project and updates the package.json and bun.lockb files accordingly.
Example
This uninstalls the axios package.