Bun – Ponder
Skip to content

Bun

Running Ponder with Bun

Bun is a toolkit for modern JavaScript and TypeScript applications. Bun includes a runtime (alternative to Node.js), a package manager (alternative to npm, pnpm, and yarn), and more.

Ponder supports Bun as both a runtime and package manager.

New project

To create a new project using Bun, just use bun --bun to run the create-ponder CLI tool. Read more. This will create a new project directoty using the Bun package manager and runtime.

shell
bun --bun create ponder {...options}

Existing project

Migrate to Bun package manager

First, follow this guide to migrate your repository to Bun's package manager.

Update package.json scripts

Next, update the scripts in package.json to use bun --bun instead of the bare ponder CLI entrypoint to opt-in to Bun's runtime.

package.json
"scripts": {
  "dev": "ponder dev", 
  "start": "ponder start", 
  "codegen": "ponder codegen", 
  "dev": "bun --bun ponder dev", 
  "start": "bun --bun start", 
  "codegen": "bun --bun ponder codegen", 
  "lint": "eslint .",
  "typecheck": "tsc"
},

Run bun dev or bun start

That's it! Now, the dev and start commands will always use the Bun runtime.

shell
bun dev

Known limitations

If you encounter an issue with Ponder that might be caused by Bun, please open a GitHub issue.

  • When using Bun, the /metrics endpoint omits all default Node.js Prometheus metrics (e.g. nodejs_heap_space_size_available_bytes and all other metrics prefixed with nodejs_ or process_). Read more.