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 🙏

© 2025 – Pkg Stats / Ryan Hefner

abbu

v1.0.7

Published

A module generator CLI

Readme

Abbu - The Ultimate CLI Tool for Module Creation

Abbu is a command-line interface (CLI) tool designed to help you quickly create and manage modules in your Node.js projects. Whether you want to generate a brand-new module or copy and customize an existing one, Abbu takes care of the heavy lifting.


Table of Contents

  1. Installation
  2. Usage
  3. How It Works
  4. Folder Structure
  5. Module Templates
  6. Contributing
  7. License

Installation

To install Abbu, you can use npm. Run the following command:

npm install -g abbu

This will install the CLI tool globally, allowing you to use it anywhere in your terminal.


Usage

After installing Abbu, you can create new modules using the following command:

npx abbu create

Steps to Create a Module:

  1. Enter the Module Name: You will be prompted to enter the name of the new module.
  2. Choose Fresh or Existing Module: You can either create a fresh module or base it on an existing one.
    • If Fresh: A new module is generated from predefined templates.
    • If Existing: You can choose an existing module to copy and customize. The system will then prompt you for confirmation and handle the copying of files.

How It Works

  1. Fresh Module Creation: If you choose to create a fresh module, Abbu generates a module with the following directory structure:

    • Controllers
    • Services
    • Models
    • Routes
    • Index File for Exports
  2. Existing Module: If you decide to use an existing module, Abbu will:

    • List all available modules in your project.
    • Allow you to select one to copy.
    • Rename relevant files and content to match the new module name.
    • Modify the module’s index file to export all necessary files.

The module templates are customizable, and you can easily expand them to fit your project’s requirements.


Folder Structure

When you run Abbu to create a new module or copy an existing one, the following folder structure is created inside the modules directory.

modules/
│── <moduleName>/
│   ├── controllers/
│   │   ├── <moduleName>.controller.ts
│   ├── services/
│   │   ├── <moduleName>.service.ts
│   ├── models/
│   │   ├── <moduleName>.model.ts
│   ├── routes/
│   │   ├── <moduleName>.route.ts
│   ├── index.ts  # Exports all files in the module

For example, if you create a module called user, the folder structure will look like this:

modules/
│── user/
│   ├── controllers/
│   │   ├── user.controller.ts
│   ├── services/
│   │   ├── user.service.ts
│   ├── models/
│   │   ├── user.model.ts
│   ├── routes/
│   │   ├── user.route.ts
│   ├── index.ts  # Exports all files in the module

Module Templates

The core of Abbu is its module templates. The following template files are provided for each module:

Controllers

Each module has a controller template (<moduleName>.controller.ts), which contains basic CRUD functionality. Here's an example for a user module:

import { Request, Response } from 'express';
import { UserService } from '../services/user.service';

export class UserController {
    static async findAll(req: Request, res: Response) {
        const data = await UserService.findAll();
        res.json(data);
    }
}

Services

Each module also has a service template (<moduleName>.service.ts), which contains the logic for interacting with the database or other services.

export class UserService {
    static async findAll() {
        // Logic to fetch data from the database
    }
}

Models

The model template (<moduleName>.model.ts) provides a structure for defining data models, often using an ORM like Mongoose.

import { Schema, model } from 'mongoose';

const userSchema = new Schema({
    name: String,
    email: String
});

export const UserModel = model('User', userSchema);

Routes

The route template (<moduleName>.route.ts) maps HTTP routes to controller actions.

import express from 'express';
import { UserController } from '../controllers/user.controller';

const router = express.Router();

router.get('/', UserController.findAll);

export default router;

Index File

Finally, an index file (index.ts) is generated to export all the module components:

export * from './controllers/user.controller';
export * from './services/user.service';
export * from './models/user.model';
export * from './routes/user.route';

Contributing

We welcome contributions to Abbu! Feel free to open issues or submit pull requests.

Steps to Contribute:

  1. Fork the repository.
  2. Create a feature branch (git checkout -b feature-name).
  3. Commit your changes (git commit -am 'Add new feature').
  4. Push to the branch (git push origin feature-name).
  5. Open a pull request with a clear description of the changes.

License

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


Conclusion

Abbu streamlines the module creation process, making it easy to set up and manage reusable code components across your Node.js projects. Whether you're creating new modules or working with existing ones, Abbu simplifies the process and helps you stay focused on writing business logic.

We hope you find Abbu useful and encourage you to contribute or extend the tool with additional features to fit your needs!

For more information, visit the Abbu NPM Package Page.