Ship production-ready REST APIs in minutes 🐿️ • Documentation 📖
Yasui (meaning "easy" in Japanese) is a lightweight Express-based framework for Node.js that brings the developer experience of modern frameworks without the complexity and maintaining minimal dependencies. It provides the structure you need with just the features you'll actually use.
- Lightweight & Fast: Built on Express with minimal dependencies. Focus on essentials without the bloat
- Complete Error Handling: Everything can throw without try/catch - automatic error handling everywhere
- Automatic Type-Casting: Query params automatically converted to proper types. Even in middlewares
- Flexible DI System: Constructor and method-level injection with configurable scopes for better control
- Simple Middlewares: Apply at global, controller, or route level. Use the same decorators as controllers
- Rich Swagger Generation: Flexible decorators for enums, arrays, classes, OpenAPI schemas.
- Type-safe: Full TypeScript support with proper typing
npm install yasuiimport yasui, { Controller, Get } from 'yasui';
@Controller('/')
export class AppController {
@Get('/')
hello() {
return { message: 'Hello World!' };
}
}
yasui.createServer({
controllers: [AppController]
});- Configuration - Server setup and global options
- Controllers - Define routes with decorators and automatic type casting
- Dependency Injection - Constructor and method-level injection with flexible scopes
- Error Handling - Automatic error catching without try/catch blocks
- Logging - Built-in timing and color-coded logging service
- Middlewares - Apply at multiple levels with same decorators as controllers
- Pipes - Transform and validate request data automatically
- Swagger Doc. - Generate OpenAPI docs with flexible decorators
YasuiJS adopts a class-based, object-oriented approach with decorators, bringing significant architectural advantages over traditional functional Express.js approaches:
Classes and decorators provide better organization, encapsulation, and maintainability. This approach naturally supports established architectural patterns like onion architecture, hexagonal architecture, and clean architecture.
Built-in dependency injection enables loose coupling, better testability, and cleaner separation of concerns. Dependencies are explicitly declared and automatically resolved.
Instead of manually registering routes and extracting parameters, you declare what you want using decorators. The framework handles the implementation details.
Contributions are welcome! Please feel free to submit issues and pull requests.
Please use npm run commit to standardize commits nomenclature.
This project is licensed under the GNU Affero General Public License v3.0 or later. See the LICENSE file for details.