Bun re-thinks the whole node package management structure of using node_modules to store all packages. You'll just need to use bun, Instead of 1,000 node_modules for development.
- Web API's such as fetch, WebSocket, and ReadableStream are build into Bun.
- A Task runner for package.json scripts
- A package manager that is compatible with NPM.
Getting started with Bun
To get start with bun you need to install bun using the bun install script.
curl https://bun.sh/install | bash
In order to use bun command on terminal add the following environment to your .bashrc in_ $HOME/.bashrc. _
... # Bun environment variables export BUN\_INSTALL=\"$bun\_install export PATH=\"\$BUN\_INSTALL/bin:\$PATH
bun add react
bun remove react
React App With Bun:
bun create react ./app cd app bun dev # start dev server
Nextjs App with Bun:
bun create next ./app cd app bun dev # start dev server
On Linux, bun install install's packages 20x - 100x faster compared to npm install. On macOS, it’s more like 4x - 80x.
Bun is fairly new and i wouldn't recommend anyone to run it in production as its still experimental and bugs are expected. However the concepts are really solid. It feels like bun is trying to re-think the whole node ecosystem while bringing in backward compatibility of node packages. Would love to see what this projects morph's to in the future.
Top comments (0)