AzuraJS - means sky blue 🌌 in many languages - is a minimal, decorator-based web framework built for TypeScript. It works on any JavaScript runtime: Node.js, Bun, Deno, Cloudflare Workers, Vercel Edge, and AWS Lambda.
Elegant, type-safe, and blazing fast.
import { AzuraClient } from "azurajs";
import { applyDecorators, Controller, Get } from "azurajs/decorators";
@Controller()
class AppController {
@Get("/")
home() {
return { message: "Hello AzuraJS! 🚀" };
}
}
const app = new AzuraClient();
app.applyDecorators([AppController]);
export default app;npm install azurajs- Zero Dependencies 📦 - No external dependencies. Lightweight and efficient.
- Decorator-Based 🎯 - Clean, intuitive routing with TypeScript decorators.
- Type-Safe 🛡️ - Full TypeScript support with complete type inference.
- JavaScript Support 📝 - Works seamlessly with plain JavaScript too.
- Multi-Runtime 🌍 - Works on Node.js, Bun, Deno, Cloudflare Workers, Vercel Edge, and more.
- High Performance ⚡ - Built for speed with minimal overhead and optimized routing.
- Modular Imports 🔧 - Tree-shakeable imports for optimal bundle size (70% smaller).
- Built-in Features 🔋 - CORS, Rate Limiting, Cookie handling, Cluster mode, and more.
- Developer Experience 😊 - Intuitive APIs with excellent IntelliSense support.
The documentation is available on azura.js.org.
import { AzuraClient } from "azurajs";
import { applyDecorators, Controller, Get, Post, Body, Param, Res } from "azurajs/decorators";
import { HttpError } from "azurajs/http-error";
import type { ResponseServer } from "azurajs";
@Controller("/api/users")
class UserController {
@Get()
getAll(@Res() res: ResponseServer) {
res.json({ users: [] });
}
@Get("/:id")
getOne(@Param("id") id: string, @Res() res: ResponseServer) {
if (id === "0") throw new HttpError(404, "User not found");
res.json({ id, name: `User ${id}` });
}
@Post()
create(@Body() body: any, @Res() res: ResponseServer) {
res.status(201).json({ id: Date.now(), ...body });
}
}
const app = new AzuraClient();
applyDecorators(app, [UserController]);
await app.listen(3000);import { AzuraClient } from "azurajs";
import { createLoggingMiddleware } from "azurajs/middleware";
const app = new AzuraClient();
const logger = createLoggingMiddleware(app.getConfig());
app.use(logger);
// Define routes
app.get("/api/users", (req, res) => {
res.json({ users: [] });
});
app.get("/api/users/:id", (req, res) => {
const { id } = req.params;
res.json({ id: Number(id), name: `User ${id}` });
});
app.post("/api/users", (req, res) => {
const body = req.body;
res.status(201).json({ id: Date.now(), ...body });
});
await app.listen(3000);AzuraJS works seamlessly across all JavaScript runtimes using the Web Standard Fetch API:
// Bun
Bun.serve({ fetch: app.fetch.bind(app), port: 3000 });
// Deno
Deno.serve({ port: 3000 }, app.fetch.bind(app));
// Cloudflare Workers
export default { fetch: app.fetch.bind(app) };- Decorator-First Design - Express-style routing with modern TypeScript decorators
- Zero Boilerplate - Write less code, ship faster
- Universal - One codebase, runs everywhere
- Production Ready - Built-in cluster mode, CORS, rate limiting, and more
- Tree-Shakeable - Modular imports reduce bundle size by up to 70%
- 📚 Documentation
- 💬 Discord
- 📦 NPM
Contributions are welcome! You can contribute in the following ways:
- Create an Issue - Propose a new feature or report a bug
- Pull Request - Fix a bug, add a feature, or improve documentation
- Share - Share your thoughts and projects built with AzuraJS
- Spread the word - Star the repo and share with others
For more details, see CONTRIBUTING.md.
Thanks to all contributors who help make AzuraJS better!
Created by 0xviny https://github.com/0xviny
Distributed under the MIT License. See LICENSE for more information.