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 🙏

© 2026 – Pkg Stats / Ryan Hefner

gen-module-cli-v2

v2.0.8

Published

CLI para generar módulos backend con arquitectura limpia

Readme

Gen Module CLI 🚀

CLI para generar módulos backend con arquitectura limpia, TypeORM y Express.

Instalación

npm install -g gen-module-cli
# o
yarn global add gen-module-cli

Uso

1. Inicializar configuración (opcional)

gen-module init

Esto crea un archivo gen-module.config.json donde puedes personalizar las rutas.

2. Generar un módulo completo

gen-module generate user
# o usar el alias
gen-module g user

Esto genera:

  • ✅ Model (user.model.ts)
  • ✅ Controller (user.controller.ts)
  • ✅ Service (user.service.ts)
  • ✅ Repository (user.repository.ts)
  • ✅ Router (user.router.ts)
  • ✅ Schema con validaciones Zod (user.schema.ts)
  • ✅ Archivos de idioma (user.ts en lang/es)
  • ✅ Utilidades (file.service, paginator-handler, library)

3. Opciones adicionales

# Omitir archivos de ejemplo
gen-module g product --skip-files

# Omitir tests
gen-module g product --skip-tests

# Usar configuración personalizada
gen-module g product --config ./my-config.json

4. Agregar componentes individuales

# Agregar solo un controller
gen-module add controller user

# Agregar solo un service
gen-module add service user

Componentes disponibles:

  • model
  • controller
  • service
  • repository
  • route
  • schema
  • lang

Configuración

Ejemplo de gen-module.config.json:

{
  "paths": {
    "controller": "src/app/controllers/v1",
    "repository": "src/app/repositories/v1",
    "service": "src/app/services/v1",
    "model": "src/app/models",
    "route": "src/api/routes/v1",
    "schema": "src/api/schemas/v1",
    "core": "src/libraries/core",
    "langEs": "src/resources/lang/es"
  },
  "templates": {
    "useCustom": false,
    "customPath": null
  }
}

Templates personalizados

Puedes usar tus propios templates:

  1. Crea una carpeta con tus templates
  2. Configura gen-module.config.json:
{
  "templates": {
    "useCustom": true,
    "customPath": "./my-templates"
  }
}

Los templates usan placeholders:

  • {{moduleName}} → nombre del módulo en minúsculas
  • {{ModuleName}} → nombre del módulo capitalizado

Ejemplo completo

# 1. Inicializar
gen-module init

# 2. Generar módulo de usuarios
gen-module g user

# 3. Generar módulo de productos
gen-module g product --skip-files

# 4. Agregar solo un controller a orders
gen-module add controller order

Características

✅ Templates como archivos reales (mejor edición) ✅ TypeScript con tipos completos ✅ Validación de nombres y rutas ✅ Logs coloridos y claros ✅ Configuración personalizable ✅ Componentes individuales ✅ Manejo de errores robusto ✅ No sobrescribe archivos existentes

Contribuir

Issues y PRs son bienvenidos en: [tu-repo-url]

Licencia

MIT */