The only cross-platform, cross-runtime, decorator-based framework for building modular applications in TypeScript.
CHO is an enterprise ready decorator-based framework for building modular applications. It uses modern JavaScript decorators to provide a clean and efficient way to define the structure of an application.
CHO applications can run on multiple JavaScript runtimes, including Node.js, Deno, Bun, and Cloudflare Workers. This allows developers to write code once and deploy it anywhere, without worrying about runtime-specific issues.
An HTTP application:
import {
ChoWeb,
type ChoWebContext,
Controller,
Get,
Injectable,
Module,
} from "@chojs/web";
@Injectable()
class UserStore {
find(id: string) {
return {id, name: "Ada"};
}
}
@Controller({route: "users", dependencies: [UserStore]})
class UsersController {
constructor(readonly store: UserStore) {
}
@Get(":id") // GET /users/42
get(ctx: ChoWebContext) {
return this.store.find(ctx.params.id!); // sent as JSON
}
}
@Module({providers: [UserStore], controllers: [UsersController]})
class App {
}
const app = await ChoWeb.create(App);
Deno.serve(app.handler); // Bun: Bun.serve({ fetch: app.handler })A command-line application, with the same modules, controllers and providers:
import {
Action,
ChoCommand,
type ChoCommandContext,
Controller,
Help,
Module,
} from "@chojs/command";
@Controller()
class Greeter {
@Help("Say hello")
@Action("hello", {string: ["name"]})
hello(ctx: ChoCommandContext) {
console.log(`Hello, ${ctx.args.name ?? "world"}!`);
}
}
@Module({controllers: [Greeter]})
class App {
}
const app = ChoCommand.create(App, {name: "greet"});
Deno.exit(await app.run(Deno.args)); // greet hello --name youPick the package for what you are building; it brings everything an application needs.
npm install --global @chojs/cliOr add it to your project with:
# an HTTP application
deno add jsr:@chojs/web
npx jsr add @chojs/web
bunx jsr add @chojs/web
# a command-line application
deno add jsr:@chojs/command
npx jsr add @chojs/command
bunx jsr add @chojs/command@chojs/web has a router built in, on the standard URL Pattern API, so an HTTP
application needs nothing else. To match requests with another HTTP library,
give ChoWeb.create the linker of an adapter:
| Router | Runs on |
|---|---|
| Built in | Deno, Node.js 24, Bun 1.3.4 and Cloudflare Workers: tested on the four |
@chojs/vendor-hono |
Deno, Node.js, Bun and edge runtimes |
@chojs/vendor-fastify |
Node.js only |
Deno and Bun run TypeScript decorators directly. On Node.js, compile the
application with TypeScript 5 or run it with a tool such as tsx.
The name of a package links to its guide, and the specification is its full description.
| Package | Version | For | Specification |
|---|---|---|---|
@chojs/web |
HTTP applications | specs | |
@chojs/command |
Command-line applications | specs | |
@chojs/message |
Applications that handle the messages of a broker, such as Kafka | specs | |
@chojs/vendor-cho |
Middlewares for the built-in router of @chojs/web, such as CORS |
||
@chojs/vendor-hono |
Running @chojs/web on Hono |
||
@chojs/vendor-fastify |
Running @chojs/web on Fastify (Node.js only) |
||
@chojs/vendor-kafka |
Running @chojs/message on Apache Kafka (tested on Deno and Bun too) |
specs | |
@chojs/vendor-nats |
Running @chojs/message on NATS, with replies |
specs | |
@chojs/openapi |
The OpenAPI document of a @chojs/web application, and its page |
specs | |
@chojs/dev |
Development tools: the endpoints of an application, and its graph | specs | |
@chojs/prompt |
Questions in a terminal: a text, a yes or no, a choice of a list | specs | |
@chojs/cli |
cho, the command-line tool of the framework |
specs | |
@chojs/core |
The dependency injection engine underneath | specs |
Runnable examples are in examples/.
Contributions are welcome: see CONTRIBUTING.md and the code of conduct.
This project uses the TC39 stage 3 decorators proposal (JavaScript decorators).



