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

easyfeat

v1.0.0

Published

A CLI tool to quickly scaffold clean code features with repository pattern, services, controllers, and more

Downloads

88

Readme

EasyFeat 🚀

A powerful CLI tool to quickly scaffold clean code features with repository pattern, services, controllers, and more for Node.js/TypeScript backend applications.

Features

  • 🏗️ Clean Architecture: Generates features following clean code principles
  • 📦 Repository Pattern: Built-in support for repository pattern with base interfaces
  • 🎯 TypeScript First: Fully typed code generation
  • 🔄 Express.js Ready: Controllers and routes ready for Express.js
  • 🗄️ MongoDB/Mongoose: Pre-configured Mongoose models and mappers
  • Validation: Joi validation schemas included
  • 🎨 Flexible: Choose between full or minimal feature scaffolding
  • 🔌 Version Support: API versioning support out of the box

Installation

Option 1: Global Installation

Install globally to use easyfeat command anywhere:

npm install -g easyfeat

Then use it:

easyfeat create user
easyfeat delete product

Option 2: Project Dependency

Install in your project:

npm install --save-dev easyfeat

Then use with npx:

npx easyfeat create user

Or add to your package.json scripts:

{
  "scripts": {
    "create-feature": "easyfeat create",
    "delete-feature": "easyfeat delete"
  }
}

Now you can run:

npm run create-feature user
npm run delete-feature product

Option 3: No Installation (npx)

Use directly without installing:

npx easyfeat create user

This downloads and runs the latest version temporarily.


Quick Start

Create Your First Feature

easyfeat create user

This creates a complete user feature with entity, repository, service, controller, routes, DTOs, validation, and more.

Usage

Create Feature

# Full feature (recommended)
easyfeat create user

# Minimal feature
easyfeat create user --minimal
easyfeat create user -m

# With API version
easyfeat create user --version v2
easyfeat create user -v v2

Delete Feature

easyfeat delete user
# or
easyfeat remove user

Help

easyfeat --help
easyfeat create --help
easyfeat delete --help

Generated Structure

Full Feature

When you run easyfeat create user, it generates:

src/
├── core/
│   └── interfaces/
│       └── base.repository.interface.ts
├── features/
│   └── user/
│       ├── entities/
│       │   └── user.entity.ts
│       ├── interfaces/
│       │   ├── i-user.repository.ts
│       │   └── i-user.service.ts
│       ├── repositories/
│       │   └── user.repository.ts
│       ├── mappers/
│       │   └── user.mapper.ts
│       ├── models/
│       │   └── user.model.ts
│       ├── dtos/
│       │   ├── create-user.dto.ts
│       │   └── update-user.dto.ts
│       ├── services/
│       │   └── user.service.ts
│       ├── controllers/
│       │   └── user.controller.ts
│       ├── routes/
│       │   └── user.routes.ts
│       └── validations/
│           └── user.validation.ts
└── routes/
    ├── index.ts
    └── v1/
        └── index.ts

Minimal Feature

The --minimal flag creates a basic structure with implementation stubs, giving you more control over the implementation.

Examples

Basic Usage

# Create a user management feature
easyfeat create user

# Create an authentication feature with minimal setup
easyfeat create auth --minimal

# Create a product feature for API v2
easyfeat create product --version v2

E-commerce Application

easyfeat create product
easyfeat create order
easyfeat create payment
easyfeat create cart

Blog Application

easyfeat create post
easyfeat create comment
easyfeat create category

Microservices

# Auth service
easyfeat create authentication
easyfeat create authorization

# Product service
easyfeat create product
easyfeat create inventory

# Order service
easyfeat create order
easyfeat create shipment

Customization

After generating a feature, customize these files:

  1. Entity (entities/*.entity.ts) - Add your domain properties
  2. Model (models/*.model.ts) - Define MongoDB schema
  3. DTOs (dtos/*.dto.ts) - Add data transfer objects
  4. Validation (validations/*.validation.ts) - Add validation rules
  5. Service (services/*.service.ts) - Implement business logic
  6. Controller (controllers/*.controller.ts) - Customize API handlers
  7. Mapper (mappers/*.mapper.ts) - Update entity/model transformations

Example: Customizing User Entity

export class User {
  id!: string;
  email!: string;
  username!: string;
  firstName!: string;
  lastName!: string;
  isActive!: boolean;
  createdAt!: Date;
  updatedAt!: Date;

  constructor(data: Partial<User>) {
    Object.assign(this, data);
  }

  get fullName(): string {
    return `${this.firstName} ${this.lastName}`;
  }

  toJSON() {
    return {
      id: this.id,
      email: this.email,
      username: this.username,
      fullName: this.fullName,
      isActive: this.isActive,
      createdAt: this.createdAt,
      updatedAt: this.updatedAt
    };
  }
}

Example: Customizing Model Schema

const UserSchema = new Schema({
  email: { type: String, required: true, unique: true, lowercase: true },
  username: { type: String, required: true, unique: true },
  firstName: { type: String, required: true },
  lastName: { type: String, required: true },
  isActive: { type: Boolean, default: true }
}, { timestamps: true });

Integration with Express

FeatForge automatically updates your route files. Just import and use in your app:

import express from 'express';
import routes from './routes';

const app = express();

app.use(express.json());
app.use('/api', routes);

app.listen(3000, () => {
  console.log('Server running on port 3000');
});

Architecture

EasyFeat generates code following these principles:

  1. Separation of Concerns - Each layer has a single responsibility
  2. Dependency Inversion - Interfaces between layers
  3. Repository Pattern - Data access abstraction
  4. DTO Pattern - Data transfer objects for API boundaries
  5. Mapper Pattern - Transform between domain and data models
  6. Validation Layer - Input validation with Joi

Requirements

  • Node.js >= 14.0.0
  • TypeScript project
  • Express.js (for generated routes)
  • Mongoose (for generated models)
  • Joi (for generated validations)

Contributing

Contributions are welcome! Please check out CONTRIBUTING.md for guidelines.

License

MIT © Nitesh

Support

If you encounter any issues or have questions, please file an issue on the GitHub repository.


Made with ❤️ by Nitesh