Free course

Bun Course

Learn Bun by running TypeScript, managing packages, using runtime APIs, building an HTTP API with SQLite, testing it, and shipping it.

5 modules · 25 lessons · No signup

Prerequisites: JavaScript and TypeScript

~~~

Your progress

of lessons completed.

Course completed.

What you'll learn

Build, test, bundle, and ship a small notes API using Bun, Web Standard APIs, and SQLite.

Take this course offline

Subscribe to my newsletter to get every free book and course in PDF and EPUB format.

Get the downloads

Course contents

  1. Bun foundations

    Install Bun, create a TypeScript project, run code, and use the development workflow.

    1. Understand what Bun includes
    2. Install and update Bun
    3. Create and run a TypeScript project
    4. Use watch mode and project scripts
    5. Check your understanding: Bun foundations
  2. Packages and scripts

    Manage dependencies, lock installs, run package binaries, and control install scripts.

    1. Install and lock dependencies
    2. Add, remove, and update packages
    3. Run package binaries with bunx
    4. Trust dependency scripts deliberately
    5. Check your understanding: packages and scripts
  3. Runtime APIs

    Read configuration, work with files, run child processes, and judge Node.js compatibility.

    1. Read environment variables and arguments
    2. Read and write files
    3. Run child processes
    4. Use Node.js packages with clear boundaries
    5. Check your understanding: runtime APIs
  4. HTTP and SQLite

    Build a notes API with Bun.serve, Web Standard requests and responses, and bun:sqlite.

    1. Start an HTTP server
    2. Route requests and return JSON
    3. Accept and validate JSON
    4. Store data with SQLite
    5. Check your understanding: HTTP and SQLite
  5. Test, build, and ship

    Test the application, create production output, compile an executable, and review the release.

    1. Write tests with bun:test
    2. Test an HTTP server
    3. Bundle server code
    4. Compile and ship the application
    5. Check your understanding: test, build, and ship