Bun is a new runtime for server-side JavaScript, optimized for speed and performance, and developer experience.

Bun is a JavaScript server runtime.

Like Node.js.

But different.

Here’s why you should learn about Bun:

  1. it is modern
  2. it is fast (claims to be a lot faster than alternatives (Node.js and Deno)
  3. provides many nice things to us developers (DX = developer experience)
  4. a lot of interesting projects are built upon Bun
  5. built-in support for TypeScript
  6. built-in support for JSX

This is already a compelling list.

What’s interesting is that Bun is meant as a drop-in replacement for Node.js, which means you can use it in most projects simply swapping npm run with bun run and that’s it, you switched to Bun.

I want to mention one good reason to use Bun, is to use Elysia or Hono, which are HTTP servers optimized for Bun, and they provide very nice features, including built-in support for JSX/TSX templates, which is my favorite thing to build interfaces in JavaScript/TypeScript.

In this unit we’ll learn the most interesting aspects of Bun.

Lessons this unit:

0: ▶︎ Introduction
1: Installing Bun
2: Running your first Bun program
3: Working with packages
4: Bun's built-in features