Skip to main content
Starting with v4.3, Orionjs uses Bun as its default runtime. This means faster startup times, native TypeScript execution without a compile step, and a simpler development workflow.

Why Bun?

  • Native TypeScript — Bun runs .ts files directly. No build step needed for development or production.
  • Faster startup — Bun starts significantly faster than Node.js, which matters during development when your server restarts on every file change.
  • Built-in watch modebun --watch replaces the need for tsx watch or nodemon.
  • Compatible — Bun is compatible with the Node.js ecosystem. Your existing npm packages, MongoDB driver, and Apollo Server all work as-is.

Getting Started

Install Bun

Create a New Project

Run in Development

That’s it. Bun watches your files and restarts the server automatically when anything changes.

Run in Production

Bun executes ./app/index.ts directly — no build step, no compiled output directory.

Migrating an Existing Project

If you have an existing Orionjs v4 project using Node.js and pnpm, here’s how to migrate:

1. Install Bun

2. Update Dependencies

3. Update package.json Scripts

4. Update Orionjs Packages

Or update all @orion-js/* packages to 4.3.0.

5. Run

Your project now runs on Bun. All existing code, schemas, services, resolvers, and MongoDB operations work without changes.

Using Node.js

Bun is the default but Node.js is fully supported. Pass --node to any CLI command:
When using --node:
  • Dev mode uses tsx watch for file watching and TypeScript execution.
  • Prod mode builds the app with esbuild first, then runs the compiled output with node --import=tsx.
This is useful if you deploy to an environment where Bun is not available, or if you hit a Bun-specific compatibility issue.

Check Available Runtimes

This shows which runtimes are available on your machine and confirms the default is Bun.

What Changed in v4.3

FAQ

Do I need to change my application code?

No. Your services, schemas, resolvers, MongoDB operations, and all other application code work the same on both Bun and Node.js.

Does Vitest still work?

Yes. Vitest runs independently of the Orionjs CLI runtime. Use bunx vitest to run your tests.

Can I use npm packages?

Yes. Bun is compatible with the npm registry and supports node_modules. All your existing dependencies work.

What about Docker deployments?

Use the official Bun Docker image:
If you prefer Node.js in production, you can develop with Bun locally and deploy with --node: