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

gmt-lazynest

v1.5.0

Published

A CLI tool for generating NestJS modules, controllers, services, and entities with interactive prompts

Readme

LazyNest

npm version License: MIT

A powerful CLI tool for generating NestJS modules, controllers, services, and entities with interactive prompts. LazyNest helps you scaffold NestJS applications quickly and efficiently.

Features

  • 🚀 Interactive CLI: User-friendly prompts for generating modules
  • 📁 Module Generator: Complete module structure with controller, service, repository, DTOs, and entities
  • 🏗️ Project Initialization: Set up common NestJS project structure
  • 🎯 TypeORM Integration: Built-in support for TypeORM entities and repositories
  • Git Hooks: Pre-configured Husky hooks for code quality (lint, format, commit validation)
  • 📝 Template-based: Consistent code generation using predefined templates
  • 🎨 Conventional Commits: Enforce commit message standards with commitlint
  • 🔧 Customizable: Flexible attribute types and configurations
  • 📦 Node Version Management: Automatic .nvmrc generation for consistent Node versions

Installation

Install globally using npm:

npm install -g gmt-lazynest

Or using pnpm:

pnpm add -g gmt-lazynest

Usage

Initialize a new project

lzn init

This command will:

  • Set up common NestJS project structure (common, config, database folders)
  • Configure TypeORM integration
  • Generate base classes and utilities
  • Create Husky git hooks for code quality:
    • Pre-commit hook (lint & format)
    • Commit-msg hook (conventional commits validation)
    • Pre-push hook (run tests)
  • Add .nvmrc file for Node version management
  • Add commitlint.config.js for commit message linting
  • Add .lintstagedrc.js for staged files linting
  • Update package.json with TypeORM migration scripts
  • Automatically clean and reinstall dependencies using pnpm

The init command will automatically run rm -rf node_modules pnpm-lock.yaml && pnpm install at the end to ensure all dependencies are properly installed.

Note: Make sure you have pnpm installed globally. If not, install it first: npm install -g pnpm

Generate a new module

lzn module

This command will generate:

  • Module file
  • Controller with CRUD endpoints
  • Service with business logic
  • Repository for database operations
  • DTOs for request/response
  • Entity with TypeORM decorators

Generated Structure

When you generate a module, LazyNest creates a complete structure:

src/
  modules/
    your-module/
      ├── your-module.module.ts
      ├── your-module.controller.ts
      ├── your-module.service.ts
      ├── your-module.repository.ts
      ├── dto/
      │   ├── create-your-module.dto.ts
      │   ├── update-your-module.dto.ts
      │   ├── filtering-your-module.dto.ts
      │   └── response-your-module.dto.ts
      ├── entities/
      │   └── your-module.entity.ts
      └── interfaces/
          └── your-module.interface.ts

Examples

Creating a User Module

$ lzn module
? Enter your module name: User
? Enter your attribute name (user): name
? Select attribute type (user - name): String
? Enter your attribute name (user): email
? Select attribute type (user - email): String
? Enter your attribute name (user): age
? Select attribute type (user - age): Number
? Do you want to add another attribute? No

This generates a complete user module with name, email, and age attributes.

Check version

lzn version

Displays the current LazyNest version.

Project Structure After Init

After running lzn init, your project will have:

.
├── .husky/
│   ├── pre-commit          # Runs lint & format before commit
│   ├── commit-msg          # Validates commit messages
│   └── pre-push            # Runs tests before push
├── .nvmrc                  # Node version specification
├── commitlint.config.js    # Commit message linting rules
├── .lintstagedrc.js        # Lint-staged configuration
└── src/
    ├── common/             # Common utilities and base classes
    │   ├── bases/          # Base entity, repository, service classes
    │   ├── decorators/     # Custom decorators
    │   ├── dto/            # Common DTOs (pagination, query params)
    │   ├── interfaces/     # Shared interfaces
    │   └── swagger/        # Swagger documentation helpers
    ├── config/             # Configuration module
    ├── database/           # Database configuration and migrations
    ├── app.module.ts       # Root application module
    └── main.ts             # Application entry point

Requirements

  • Node.js >= 16
  • NestJS project
  • TypeORM (for database integration)

Development

Local Development Testing

To test LazyNest locally without publishing to npm:

  1. Build the project:
  • pnpm (for dependency management) - Install with: npm install -g pnpm

    cd /path/to/lazynest
    npm run build
  1. Run directly:

    node dist/src/main.js init
    # or
    node dist/src/main.js module
  2. Using npm link (optional):

    npm link
    # Then in another project:
    lzn init
  3. Using npm pack:

    npm pack
    # Install in test project:
    npm install /path/to/gmt-lazynest-1.x.x.tgz

Publishing Updates

  1. Commit your changes:

    git add .
    git commit -m "feat: your feature description"
  2. Update version (choose one):

    npm run release:patch  # Bug fixes (1.1.3 -> 1.1.4)
    npm run release:minor  # New features (1.1.3 -> 1.2.0)
    npm run release:major  # Breaking changes (1.1.3 -> 2.0.0)
  3. Publish to npm:

    npm run publish:npm
  4. Push to GitHub:

    git push --follow-tags origin master

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you find this tool helpful, please consider giving it a ⭐ on GitHub!

Author

Created by Developer Gamatecha

Stay in touch

License

Nest is MIT licensed.

lazynest

[Backend]