Skip to main content

Balda.js

Balda.js is a runtime-agnostic backend framework that lets you write once and run anywhere—Node.js, Bun, and Deno—without changing a single line of code. Its minimal core and decorator-based API make building fast, type-safe HTTP services straightforward and clean.

Key Ideas

  • Cross-Runtime: One codebase, three runtimes. Choose the engine that best suits your deployment without vendor lock-in. Bun and Deno already have compatibility with Node.js, this project aims to make the most of all runtimes using the native APIs. For example, Deno.serve is used to serve the server on Deno, Bun.serve is used to serve the server on Bun, and http.createServer is used to serve the server on Node.js.
  • Performance First: Tight, low-overhead abstractions keep the request/response path lean.
  • TypeScript-Native: Written in TypeScript from the ground up for rich typings and editor autocompletion.
  • Batteries Included: Controllers, middleware, validation, serialization, cron jobs, queues, CLI, GraphQL, and a plugin ecosystem supplied out of the box.
  • Elegant API: Decorators for routes and middleware promote self-documenting code and clean project structure.
  • GraphQL Support: Optional built-in GraphQL integration with GraphQL Yoga for modern API development with full type safety.
  • Swagger/OpenAPI: Built-in support for Swagger/OpenAPI documentation that merges with your codebase since validators and serializers directly generate the OpenAPI schema without any additional effort.
  • Validation: Built-in request validation using zod schemas for body and query parameters.

Tiny Example

import { Server, get, controller, Request, Response } from 'balda-js';

const server = new Server({ port: 3000 });

@controller()
class WelcomeController {
@get('/')
async hello(_: Request, res: response) {
res.text('Hello, World!');
}
}

server.listen();

Learn More

Balda.js—simple, fast, and everywhere.