
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
han-framework
Advanced tools
A modern, developer-friendly Node.js framework inspired by NestJS
Han Framework eliminates configuration complexity while providing powerful features out of the box. Built for developers who want to focus on building great applications, not wrestling with setup.
| Feature | Han Framework | NestJS |
|---|---|---|
| Setup Time | 2 minutes | 15+ minutes |
| Configuration | Zero config needed | Manual setup required |
| Shutdown Hooks | Automatic | Manual enableShutdownHooks() |
| Security | Built-in CORS + Helmet | Manual configuration |
| Environment Detection | Automatic | Manual setup |
| Route Analytics | Built-in visual dashboard | Not included |
npm install han-framework
# or
yarn add han-framework
// app.module.ts
import { Module } from 'han-framework';
import { AppController } from './app.controller';
@Module({
controllers: [AppController]
})
export class AppModule {}
// app.controller.ts
import { Controller, Get } from 'han-framework';
@Controller()
export class AppController {
@Get()
hello() {
return { message: 'Hello Han Framework!' };
}
}
// index.ts
import 'reflect-metadata';
import { HanFactory } from 'han-framework';
import { AppModule } from './app.module';
async function bootstrap() {
const app = await HanFactory.create(AppModule);
await app.listen(3000);
}
bootstrap();
npm start
That's it! 🎉 Your app is running with:
No setup required - everything works out of the box with sensible defaults.
// This gives you a production-ready app
const app = await HanFactory.create(AppModule);
await app.listen(3000);
Automatically configures based on your deployment environment.
localhost, enhanced logging0.0.0.0, optimized performanceGraceful shutdown and cleanup happen automatically - no manual setup needed.
// Automatically handles SIGINT/SIGTERM
// Provides graceful shutdown with timeout protection
// Cleans up resources properly
Security best practices are enabled by default.
Simple, intuitive hooks for request lifecycle management.
// Add global interceptors
app.useGlobalInterceptors(LoggingInterceptor);
app.useGlobalInterceptors(new PerformanceInterceptor(200));
Beautiful route dashboard displayed on startup.
🚀 Han Framework - Application Started
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
📊 Route Analytics Dashboard:
🎯 Total Routes: 4
🏛️ Controllers: 2
📅 Generated: 9/29/2025, 10:38:18 PM
🔢 HTTP Methods Breakdown:
📖 GET : 3 routes (75.0%)
📝 POST : 1 routes (25.0%)
📍 Route Mappings by Controller:
┌─ [AppController] (2 routes)
├─ 📖 GET /api/health
└─ 📖 GET /api/info
┌─ [WebhookController] (2 routes)
├─ 📝 POST 🛡️ /api/webhook/github [+2 middleware]
└─ 📖 GET /api/webhook/status
const app = await HanFactory.create(AppModule, {
globalPrefix: '/api/v1', // Add API prefix
cors: true, // Enable CORS (default: true)
helmet: true, // Enable security headers (default: true)
bodyParser: true // Enable body parsing (default: true)
});
const app = await HanFactory.create(AppModule, {
// CORS Configuration
cors: {
origin: ['https://yourdomain.com'],
credentials: true,
methods: ['GET', 'POST', 'PUT', 'DELETE']
},
// Security Configuration
helmet: {
contentSecurityPolicy: {
directives: {
defaultSrc: ["'self'"],
scriptSrc: ["'self'", "'unsafe-inline'"]
}
}
},
// Shutdown Configuration
shutdownHooks: {
enabled: true, // Enable graceful shutdown (default: true)
gracefulTimeout: 15000, // 15 second timeout (default: 10000)
signals: ['SIGINT', 'SIGTERM'] // Signals to handle
}
});
Register cleanup operations that run automatically during shutdown.
// Database cleanup
app.onApplicationShutdown(async () => {
await database.close();
console.log('Database connections closed');
});
// Cache cleanup
app.onApplicationShutdown(() => {
cache.clear();
console.log('Cache cleared');
});
Add request/response processing that applies to all routes.
// Built-in interceptors
app.useGlobalInterceptors(LoggingInterceptor);
app.useGlobalInterceptors(new PerformanceInterceptor(200));
// Custom interceptor
class AuthInterceptor {
beforeHandle(context) {
// Pre-request logic
}
afterHandle(context, response) {
// Post-request logic
}
onError(context, error) {
// Error handling
}
}
app.useGlobalInterceptors(new AuthInterceptor());
Full dependency injection support with automatic resolution.
@Injectable()
export class UserService {
findAll() {
return [{ id: 1, name: 'John' }];
}
}
@Controller('users')
export class UserController {
constructor(private userService: UserService) {}
@Get()
getUsers() {
return this.userService.findAll();
}
}
Organize your application with a modular architecture.
@Module({
imports: [DatabaseModule, AuthModule],
controllers: [UserController],
providers: [UserService],
exports: [UserService]
})
export class UserModule {}
const app = await HanFactory.create(AppModule);
await app.listen(3000);
// Automatically configures for development environment
const app = await HanFactory.create(AppModule, {
shutdownHooks: {
gracefulTimeout: 30000 // Longer timeout for production
}
});
const port = process.env.PORT || 3000;
await app.listen(port);
// Automatically configures for production environment
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build
CMD ["npm", "start"]
# Han Framework automatically detects container environment
@Controller('users')
export class UserController {
@Get()
findAll() {
return [{ id: 1, name: 'John' }, { id: 2, name: 'Jane' }];
}
@Get(':id')
findOne(@Param('id') id: string) {
return { id, name: 'John' };
}
@Post()
create(@Body() user: CreateUserDto) {
return { id: 3, ...user };
}
}
@Controller()
export class EventsController {
@WebSocketGateway()
handleConnection(client: any) {
console.log('Client connected:', client.id);
}
@SubscribeMessage('message')
handleMessage(client: any, payload: any) {
return { event: 'message', data: payload };
}
}
// Create a microservice instead of HTTP server
const microservice = await HanFactory.createMicroservice(AppModule, {
transport: Transport.TCP,
options: { port: 3001 }
});
await microservice.listen();
Han Framework is designed to be compatible with NestJS applications. Most NestJS code works without changes:
// Your existing NestJS controllers work as-is
@Controller('users')
export class UserController {
@Get()
findAll() {
return this.userService.findAll();
}
}
// Your existing modules work as-is
@Module({
imports: [UserModule],
controllers: [AppController]
})
export class AppModule {}
| Aspect | Han Framework | NestJS |
|---|---|---|
| Setup | Zero config | Manual config |
| Shutdown | Automatic | Manual |
| Security | Built-in | Manual setup |
| Interceptors | Simple hooks | RxJS observables |
| Environment | Auto-detection | Manual configuration |
| Performance | Built-in monitoring | External packages |
src/
├── controllers/ # Route handlers
│ ├── app.controller.ts
│ └── user.controller.ts
├── services/ # Business logic
│ ├── app.service.ts
│ └── user.service.ts
├── modules/ # Feature modules
│ ├── user.module.ts
│ └── auth.module.ts
├── interceptors/ # Request/response hooks
│ ├── logging.interceptor.ts
│ └── auth.interceptor.ts
├── app.module.ts # Root module
└── index.ts # Application entry point
We welcome contributions! Please see our Contributing Guide for details.
git clone https://github.com/your-org/han-framework
cd han-framework
npm install
npm run dev
npm test # Unit tests
npm run test:e2e # End-to-end tests
npm run test:coverage # Coverage report
MIT License - see LICENSE for details.
Inspired by the excellent work of the NestJS team. Han Framework builds upon their concepts while focusing on developer experience and automation.
Ready to build something amazing? 🚀
Get started with Han Framework today and experience the joy of zero-configuration development with enterprise-grade features built-in.
npm install han-framework
Built with ❤️ for developers who want to focus on building, not configuring.
FAQs
**A modern, developer-friendly Node.js framework inspired by NestJS**
We found that han-framework demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.