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

@stechy1/schematics

v1.0.3

Published

Collection of custom schematics for easier creating CQRS structure in NestJS project.

Readme

About

This project contains helper schematics for generating unified structure of NestJS project which uses CQRS.

NX Monorepository is necessary to get expected results.

Usage

Import this package as your dev dependencies: npm install --dev @stechy1/schematics

Then to create new feature call nx generate @stechy1/schematics:nest-lib feature-name where feature-name is the name of the feature.

This call will create the following structure in libs directory:

libs
|-- feature-name
    |-- application
    |   |-- src
    |   |   |-- lib
    |   |   |   |-- command
    |   |   |   |   |-- handlers
    |   |   |   |   |-- impl
    |   |   |   |   |-- index.ts
    |   |   |   |-- event
    |   |   |   |   |-- handlers
    |   |   |   |   |-- impl
    |   |   |   |   |-- index.ts
    |   |   |   |-- query
    |   |   |   |   |-- handlers
    |   |   |   |   |-- impl
    |   |   |   |   |-- index.ts
    |   |   |   |-- saga
    |   |   |   |   |-- index.ts
    |   |   |   |-- service
    |   |   |   |   |-- feature-name.service.ts
    |   |   |   |-- feature-name.application.module.ts
    |   |   |-- index.ts
    |-- domain
    |   |-- src
    |   |   |-- lib
    |   |   |   |-- exception
    |   |   |   |-- model
    |   |   |   |   |-- dto
    |   |   |   |   |   |-- index.ts
    |   |   |   |   |-- entity
    |   |   |   |   |   |-- index.ts
    |   |   |   |-- repository
    |   |   |   |-- feature-name.domain.module.ts
    |   |   |-- index.ts
    |-- infrastructure
    |   |-- src
    |   |   |-- lib
    |   |   |   |-- controller
    |   |   |   |   |-- feature-name.controller.ts
    |   |   |   |-- service
    |   |   |   |   |-- feature-name.facade.ts
    |   |   |   |-- feature-name.infrastructure.module.ts
    |   |   |-- index.ts

Infrastructure part

The Infrastructure part is used as access point to the API. There are two folders: controller and service with already generated files with proper names. In Controller file, there is definition of API. Facade is used only as connection layer between Controller and CQRS.

Application part

The Application part is a place, where the core usage of CQRS is happening. impl directory is for commands, events and queries definitions. handlers directory is place where is implementation of each command, event or query. Every handler of command, event, query or saga itself needs to be added to a constant in the index.ts file.

There is also a root index.ts of application part. In this file there are definitions of files, which are provided by application part. Mainly there is a place for commands, events and queries definitions.

Do not export anything from service or saga. It should not be necessary.

Domain part

The Domain part contains everything releated to domain. It includes exceptions, repositories, entities and DTOs. Repositories, entities and DTOs contains index.ts file. Every file created in Repositories, entities or DTOs needs to be added to proper index.ts file. In feature-name.module.ts file, repositories and entities are used in typeorm definition.

Dependency graph

Dependency graph

Complex dependency graph

Complex dependency graph