DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Cover image for Bun - The fastest Javascript Runtime
Jordan Soo Yen Yih
Jordan Soo Yen Yih

Posted on

Bun - The fastest Javascript Runtime

Bun - the new Javascript runtime has just announced its first beta release and makes the claimed that it's significantly faster than Node and Deno, not just a little bit faster, but orders of magnitude faster. What makes Bun special?

Performance ⚑

It doesn't use the V8 engine but instead uses the JavaScriptCore from WebKit which is generally considered to be faster. In addition it's written in a low level programming language called ZIG that similar to C or Rust and the creator of Bun say ZIG the lack of hidden control flow makes it much simpler to write fast software.

All-IN-ONE Runtime 🎁

  • Native module bundler to replace tools like Webpack.
  • Native transpiler to support Typescript code out of the box.
  • Top level await (just like DenoπŸ¦–)
  • Auto transpile JSX files
  • Supports WebAPI like fetch, WebSocket and ReadableStream
  • Supports many Node core modules as well as Node API which will allow many NPM packages also work in Bun.
  • Implements Node.js' module resolution algorithm, means you can install packages from npm into bun and those packages install 20x faster.⚑😲
  • Environment variables load automatically, no more dotenv.
  • Native test runner like Jest.

Try it out, if you are using Windows, you are required to use WSL to install Bun.

Thank you for reading.

Top comments (7)

Collapse
apvarun profile image
Varun A P ⚑️

And what an excellent project requires is an Awesome page πŸ˜„

github.com/apvarun/awesome-bun

PS: Bun is awesome (breath of fresh air) and I believe it will force the competition to also invest in performance.

Collapse
lukeshiru profile image
Luke Shiru

Tried it and is excellent. Maybe not great for pre-existing projects (because of all the work you'll have to do removing old stuff), but for new projects it looks really promising.

Collapse
yenyih profile image
Jordan Soo Yen Yih Author

Agree, but if the performance do matters for the existing projects, then it is worth to do so. 😁

Collapse
urielsouza29 profile image
Uriel dos Santos Souza

Just-JS - Why is Javascript in the top 2 of techempower?

Collapse
philip profile image
Philip Kumah Jr • Edited on

Great. This is awesome

Collapse
rngala profile image
Roney Ngala

With a native bundler, transpiler, task runner, and NPM client built-in; it's a breath of fresh air.

Collapse
bcostaaa01 profile image
Bruno

I definitely need to try this!

🌱 DEV runs on 100% open source code known as Forem.

Β 
Contribute to the codebase or learn how to host your own.