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 🙏

© 2024 – Pkg Stats / Ryan Hefner

nemscaf

v1.0.1

Published

A CLI tool to quickly generate a boilerplate for Node.js, Express, and MongoDB applications. Customize your project setup by enabling options like authentication, and automatically install necessary dependencies. Ideal for developers who need to quickly s

Downloads

113

Readme

NEMSCAF CLI Tool

NEMSCAF (Node Express MongoDB) is a Command Line Interface (CLI) tool designed to scaffold Node.js, Express, and MongoDB projects efficiently. This tool allows developers to generate a boilerplate project with customizable features like authentication and data validation, ensuring a faster and standardized development process.


Features

  • Quick Setup: Generate a fully functional project with just one command.
  • Customizable Authentication: Choose between JWT (default) or PassportJS for user authentication.
  • Validation Options: Integrate Joi for request data validation to sanitize and structure user input.
  • Modular and Scalable Codebase: The boilerplate is designed with clean, modular, and scalable architecture.

Installation

To install the CLI globally, run:

npm install -g nemscaf

Usage

After installation, you can use the nemscaf command to create and manage projects.

General Command

nemscaf

Displays the general help and available commands:

Usage: nemscaf [options] [command]

A Command Line Interface (CLI) tool to scaffold Node.js, Express, and MongoDB projects with customizable boilerplate code for authentication and validation.

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

Commands:
  create [options] <dirName>  Generate a new project with Node.js, Express, and MongoDB. Customize the project setup with additional options for authentication and validation.
  help [command]              display help for command

Create Command

The create command generates a new Node.js, Express, and MongoDB project.

Usage

nemscaf create [options] <dirName>

Arguments

| Argument | Description | | --------- | ------------------------------ | | dirName | Name of the project directory. |

Options

| Option | Description | | ------------ | --------------------------------------------- | | --passport | Integrate PassportJS for user authentication. | | --joi | Include Joi for request data validation. | | -h, --help | Display help for the create command. |

Examples

  1. Default Setup
    Without any options, the CLI sets up a project using JWT for authentication and excludes input validation.

    nemscaf create my-app
  2. With PassportJS Authentication
    Includes PassportJS for handling user authentication.

    nemscaf create my-app --passport
  3. With Joi Validation
    Adds Joi for request data validation.

    nemscaf create my-app --joi
  4. With Both PassportJS and Joi
    Combines PassportJS authentication with Joi validation.

    nemscaf create my-app --passport --joi

Default Behavior

  • Authentication:

    • If --passport is not specified, the project uses JWT for user authentication.
    • The default JWT setup includes token generation and verification functionalities.
  • Validation:

    • If --joi is not included, no input validation is applied. This means user input will not be sanitized before being saved to MongoDB.

Project Structure

The generated project includes the following structure:

my-app/
├── src/
│   ├── controllers/
│   ├── middlewares/
│   ├── models/
│   ├── routes/
│   └── utils/
├── .env
├── .gitignore
├── index.js
├── package.json
└── README.md`

Key Files and Directories

  • src/controllers: Handles the logic for each route.
  • src/middlewares: Middleware functions for authentication, validation, etc.
  • src/models: Mongoose schemas and models for MongoDB.
  • src/routes: Route definitions for the API.
  • src/utils: Utility functions (e.g., token generation, error handling).

Contributing

Contributions, issues, and feature requests are welcome!
Feel free to check the issues page or submit a pull request.


License

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


Author

Developed by Bharat Raj Verma.