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

nest-ddd-flety

v0.0.1

Published

CLI to scaffold NestJS code following Feature-Sliced Design (FSD) and Domain-Driven Design (DDD) principles.

Readme

nest-ddd-flety

CLI moderno para proyectos NestJS enfocado en generar código bajo los principios de Feature-Sliced Design (FSD) y Domain-Driven Design (DDD).

Permite crear rápidamente features completas, aggregates, value objects, entidades, casos de uso, repositorios y controladores con una estructura de capas coherente.

Requerimientos

  • Node.js 18 o superior.
  • Un proyecto NestJS válido (debe contar con nest-cli.json o @nestjs/core en sus dependencias, y la carpeta src).

Instalación

Instalación local para desarrollo

npm install
npm run build
npm link

Después de npm link, el binario nest-ddd-flety queda disponible de forma global mientras trabajás en el proyecto.

Instalación como dependencia (no publicado aún)

npm install git+https://github.com/tu-org/nest-ddd-flety.git

Luego usá el binario mediante npx:

npx nest-ddd-flety --help

Uso general

nest-ddd-flety --help

Salida esperada:

Usage: nest-ddd-flety [options] [command]

CLI para generar código bajo arquitectura FSD y DDD en NestJS

Options:
  -V, --version                  output the version number
  -h, --help                     display help for command

Commands:
  generate|g <schematic> [name]  Elemento FSD/DDD a generar
  info|inf <schematic>           Muestra la guía técnica de un schematic
  help [command]                 display help for command

Comandos disponibles

| Comando | Alias | Descripción | | ------- | ----- | ----------- | | generate <schematic> [name] | g | Genera un artefacto FSD/DDD en el proyecto NestJS actual. | | info <schematic> | inf | Muestra la guía técnica, uso y ejemplo de un schematic. |

Schematics soportados

| Schematic | Alias | Descripción | | --------- | ----- | ----------- | | feature | f | Crea una feature completa con capas domain, application e infrastructure, e integra el módulo en app.module.ts. | | aggregate | agg | Crea una clase Aggregate Root dentro de la capa de domain. | | value-object | vo | Crea un Value Object inmutable con validaciones. | | entity | en | Crea una Entidad de dominio identificada por un ID. | | use-case | uc | Crea un Caso de Uso (Application Service). | | repository | repo | Crea la implementación concreta de un repositorio en infrastructure. | | controller | ctrl | Crea un Controlador HTTP REST en infrastructure. |

Ejemplos

Crear una feature completa

nest-ddd-flety g feature v2/modules/users/user

Genera la estructura bajo src/v2/modules/users/user con las capas FSD y registra el módulo en src/app.module.ts.

Crear un Aggregate Root

nest-ddd-flety g aggregate v2/modules/users/order

Crear un Value Object

nest-ddd-flety g vo v2/modules/users/email

Crear un repositorio

nest-ddd-flety g repo v2/modules/users/user

Ver la guía técnica de un schematic

nest-ddd-flety info feature
# o con alias
nest-ddd-flety inf f

Estructura generada por feature

src/v2/modules/users/user
├── domain
│   └── user.entity.ts
├── application
│   └── get-user.use-case.ts
├── infrastructure
│   └── user.controller.ts
└── user.module.ts

La feature se registra automáticamente en src/app.module.ts si el archivo existe.

Desarrollo

Scripts disponibles

| Script | Descripción | | ------ | ----------- | | npm run dev | Ejecuta la CLI en modo desarrollo con tsx. | | npm run build | Compila el proyecto con tsup y genera el bundle en dist/. |

Compilar y probar localmente

npm run build
npm link
nest-ddd-flety --help

Arquitectura del proyecto

src/
├── commands/        # Comandos expuestos por la CLI (generate, info)
├── generators/      # Lógica de generación de archivos y plantillas
│   └── feature/     # Helpers específicos de la feature completa
├── utils/           # Utilidades (ayuda, versión, validación de proyecto, docs)
└── index.ts         # Punto de entrada de la CLI

Notas

  • Todos los comandos generate validan primero que estés parado en la raíz de un proyecto NestJS.
  • Si el schematic no está implementado, el comando lo informa sin generar archivos.
  • Las rutas pueden escribirse con barras normales (/) o invertidas (\\) gracias a la normalización interna.

Licencia

MIT