Install Bun
Installation guide for Bun.
Install Bun
Bun is a new JavaScript runtime environment developed from the ground up to meet the needs of the modern JavaScript ecosystem. It pursues three major design goals, including speed. Bun boots and runs quickly. It extends JavaScriptCore, the powerful JavaScript engine built for Safari. Fast startup times mean fast apps and APIs.
Installation
- Navigate to this site: https://bun.sh
- Copy the installation command for your computer.
- Run the command
- With
powershell
for Windows - With
bash
for Linux & macOS
- With
Verification
Open your terminal and enter this command:
1
2
3
bun --version
# or
bun -v
Justification
I decided to migrate the CX translation webhook to Bun-Hono to reduce the cold start time when Google Cloud Run needs to start an instance, and I also migrated the service to TypeScript to improve maintainability.
- The exclamation points are deployments, when the changes were made on April 2nd and 3rd, 2025.
- During the first deployment phase, I changed the environment used to reduce startup times.
- The improvement wasn’t significant, so I looked for other solutions. Since Bun is compatible with all Node.js projects, I tried migrating. The improvement was good, but there were some issues; the maintainability and readability of the project weren’t the best. - That’s why I migrated to Hono with Bun and TypeScript which would add type safety. In the second phase of deployment, after the migration, I deployed the project directly in TypeScript and the startup time had increased. That’s why I had to compile the project with
tsc
in JavaScript and everything was perfect.
This post is licensed under CC BY 4.0 by the author.