npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

flare-api

v2.0.0

Published

Framework Node.js/TypeScript que combina la simplicidad de FastAPI con el poder de NestJS, superado con IA integrada

Readme

🚀 Flare API

Framework Node.js/TypeScript que combina la simplicidad de FastAPI con el poder de NestJS, superado con IA integrada.

npm version License: MIT

Motor HTTP: Express.js


✨ Características Principales

🎯 Core Features (Feature Parity con NestJS)

  • ✅ Dependency Injection completo con scopes
  • ✅ Guards (autenticación/autorización)
  • ✅ Interceptors (logging, transformación, cache)
  • ✅ Pipes (validación y transformación)
  • ✅ Modules (opcional)
  • ✅ TypeScript 100% tipado

🤖 Features Únicas

  • 🚀 CLI con IA - Genera código desde lenguaje natural
  • 🎨 Visual Debugger - Dashboard web en tiempo real
  • 🔍 AI Code Review - Revisión automática de código
  • Zero-Config - Funciona sin configuración
  • 📦 Templates - Proyectos completos listos
  • 🚢 Multi-Platform Deployment - Docker, AWS, Azure, etc.

🏆 Enterprise Features

  • 🤖 IA en Runtime con Workers - Procesamiento pesado en workers separados
  • 📊 Logs Estructurados - JSON con contexto completo (requestId, traceId, correlationId)
  • 📈 Prometheus Monitoring - Métricas avanzadas integradas
  • 🌐 API Gateway Separado - Opcional, arquitectura modular
  • 🔒 Seguridad Automática - Helmet, CORS, XSS, HSTS, Rate Limiting
  • 📖 Documentación Viva - Swagger auto-actualizado
  • 🔥 Hot Reload Inteligente - Recarga selectiva sin perder estado

🚀 Quick Start

# Opción 1: Crear proyecto nuevo
npx flare-api init my-api
cd my-api && npm install && npm run dev

# Opción 2: Desde template
npx flare-api template ecommerce my-shop

# Opción 3: Manual
npm install flare-api
import { FlareApplication, Controller, Get, Post, Body } from 'flare-api';
import { IsString, IsEmail } from 'class-validator';

class CreateUserDto {
  @IsString() name!: string;
  @IsEmail() email!: string;
}

@Controller('/users')
class UserController {
  @Get()
  findAll() {
    return { users: [] };
  }

  @Post()
  create(@Body() body: CreateUserDto) {
    return { message: 'User created', user: body };
  }
}

const app = new FlareApplication({ globalPrefix: '/api' });
app.registerController(UserController);
app.listen(3000);

🎯 CLI Inteligente

# Generar desde lenguaje natural
flare create "Crear API para gestionar productos con nombre, precio y descripción"

# Generar componentes
flare generate controller User
flare g service Product

# Templates
flare template ecommerce my-shop
flare template blog my-blog
flare template saas my-saas

🎨 Features Avanzadas

IA en Runtime con Workers

const app = new FlareApplication({ aiWorkers: true });

// GET /api/observability
// - Explicaciones de endpoints
// - Métricas en tiempo real
// - Anomalías detectadas
// - Sugerencias de optimización

Logs Estructurados

// Logs automáticos con contexto completo
// En producción: JSON estructurado
// En desarrollo: Formato legible

import { logger } from 'flare-api';

// Logger con contexto
const contextLogger = logger.withContext({ 
  requestId: 'req-123',
  traceId: 'trace-456' 
});
contextLogger.info('User created', { userId: 123 });

ORM Nativo Opcional

import { flareORM } from 'flare-api';

const userRepo = flareORM.getRepository(User);
const users = await userRepo.find();
const user = await userRepo.create({ name: 'John' });

// O usar TypeORM directamente
import { DataSource } from 'typeorm';
const dataSource = await getDataSource();

API Gateway Separado

// Opcional - importar solo si se necesita
import { apiGateway } from 'flare-api/gateway';

apiGateway.addRoute({
  path: '/api/users',
  service: 'user-service',
  rateLimit: { windowMs: 60000, max: 100 },
  circuitBreaker: true,
});

Monitorización Prometheus

const app = new FlareApplication({ prometheus: true });

// Endpoint automático: GET /metrics
// Métricas: request duration, total requests, errors, active connections

Seguridad Automática

// Se activa automáticamente
// - Helmet headers
// - CORS configurable
// - XSS Protection
// - HSTS
// - Rate Limiting

🏗️ Arquitectura Modular Opcional

Flare API permite usar módulos solo si los necesitas:

  • Bottom-Up: Sin módulos para proyectos pequeños
  • Top-Down: Con módulos para proyectos grandes

La arquitectura se adapta a ti, no al revés.


📊 Endpoints Automáticos

  • GET /health - Health check completo
  • GET /health/live - Liveness probe (Kubernetes)
  • GET /health/ready - Readiness probe (Kubernetes)
  • GET /api/observability - Métricas y explicaciones de IA
  • GET /metrics - Métricas Prometheus
  • GET /api-docs - Documentación Swagger

🆚 Comparación con NestJS

| Característica | NestJS | Flare API | |---------------|--------|-----------| | DI System | ✅ | ✅ | | Guards | ✅ | ✅ | | Interceptors | ✅ | ✅ | | Pipes | ✅ | ✅ | | Modules | ✅ | ✅ (Opcional) | | CLI con IA | ❌ | ✅ ÚNICO | | Visual Debugger | ❌ | ✅ ÚNICO | | IA en Runtime | ❌ | ✅ ÚNICO | | Workers para IA | ❌ | ✅ ÚNICO | | Logs Estructurados | ⚠️ | ✅ Completo | | Prometheus | ❌ | ✅ Integrado | | API Gateway | ❌ | ✅ Separado | | Zero-Config | ❌ | ✅ | | Simplicidad | ⚠️ | ✅ Más simple |


📚 Documentación


🎬 Demo Completo

Ver examples/complete-demo.ts para un ejemplo completo con todas las features.

npm run dev examples/complete-demo.ts

🛠️ Comandos CLI

flare init my-api              # Crear proyecto
flare create "description"    # Generar desde lenguaje natural
flare generate controller User # Generar componente
flare template ecommerce      # Crear desde template
flare test --generate         # Generar tests
flare review                  # Code review
flare deploy docker           # Generar configs de deployment

🏢 Enterprise Ready

Flare API cumple con todos los requisitos para uso empresarial:

  • Tests unitarios y de integración - Generación automática
  • Documentación completa - Guías detalladas
  • Logs estructurados - JSON con contexto completo
  • Workers para IA - Procesamiento asíncrono
  • API Gateway separado - Arquitectura modular
  • Demo real funcionando - Ejemplo completo
  • Monitorización integrada - Prometheus listo

⚡ Rendimiento

Construido sobre Express.js con bajo overhead. Optimizaciones:

  • Lazy loading de módulos
  • DI eficiente con scopes
  • Hot reload selectivo
  • Caching inteligente

📦 Instalación

npm install flare-api
# o
yarn add flare-api

🤝 Contribuir

Contribuciones son bienvenidas. Ver CONTRIBUTING.md para más detalles.


📄 Licencia

MIT License - ver LICENSE para más detalles.


🎉 ¿Por qué Flare API?

  • Más simple que NestJS (módulos opcionales)
  • Más poderoso con IA integrada
  • Mejor DX con Visual Debugger y Hot Reload
  • Zero-Config - funciona sin setup
  • Enterprise Ready - listo para producción
  • Bajo Overhead - rápido y eficiente

Flare API: El framework más completo para APIs. 🚀