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

@mentormate/node-cli

v3.4.0

Published

Node CLI

Downloads

57

Readme

MM Node.js CLI-Pipeline

Commitizen friendly

A CLI tool for generating Node.js projects.

Installation

Install globally with npm install -g @mentormate/node-cli and start generating projects by running node-cli g [project name] inside your root Projects folder. The generated project will be in its own folder inside the current one.

Commands

  • generate / g [project name] - This command starts the process of generating your Node.js project.

    There are three ways to generate it:

    • node-cli g [project name] --interactive - Interactive mode
    • node-cli g [project name] --example-app - Generate an example application
    • node-cli g [project name] - No flags. By default, the command will generate a basic express application when no flags are supplied.
  • version / v / --version / -v - Outputs the current version of the CLI tool

  • help / h / --help / -h - Lists the available commands and their aliases

Flags

  • --interactive - Start an interactive mode. You will have to answer a couple of questions so the result will be customized according to your needs.
  • --example-app - You will have to choose between express and Nest.js to generate an example ToDo application.

Features

  • When --example-app flag is used, the generated ToDo app will include the following features:  

    • Language: typescript
    • Db: postgresql
    • JS code linters: prettier and eslint
    • Hooks with husky: commitlint, commitizen, pre-commit, pre-push
    • Containerization with docker
    • Unit and E2E tests with jest and supertest
    • JWT authentication
    • API documentation with openapi
    • TypeScript-first schema validation with zod
    • Query Builder with knex
    • Global error handling  
  • When --interactive flag is used, it will start prompting question so you can customize the project you want to create. After the initial naming you will be provided with the following options:

For an exaustive list of features refer to the features document.

Framework

  • Express
  • Nest.js - this option will automatically install its predefined linter settings and will always use TypeScript

Language

Although you will be provided with two options - TypeScript and JavaScript the usage of the latter is strongly discouraged. Only for edge cases, small projects and only after getting permission from your project's architect/team lead you should choose the JavaScript option

Features select

You will be presented with a selection of features that you can choose to be included in your project. The default choice will include all of the listed features. The features are as follows:

  • JS code linters - this option will install prettier and eslint as dev-dependencies on your project and setup some initial configuration according to a common MentorMate standard.

  • Hooks with husky - this option will setup husky for your project and depending on your choice can add:

    • Commit hook - the hook will enforces usage of proper commit messages using commitlint and commitizen. commitizen will guide you through a friendly CLI when npx cz command is used instead of git commit:

      commitizen.png

      It is all about using Conventional Commits

    • Pre-commit hook - the hook will run code and filename linters on the staged files and check for possible unwanted secrets/keys committed

    • Pre-push hook - this hook is just a placeholder. For now no action will happen here, but you can configure it by your needs

  • Containerization with Docker - this option will create a Dockerfile file for building Docker images of your application.

Testing

A configured Jest setup will always be included in your project, along with a GitHub workflow that will run on opening PRs that target the main/master branch and on every subsequent push to the origin branch of the PR.

Folder structure

If you have supplied --example-app flag, you are going to get a folder structure already setup for your project. The structure will include database configuration, models folders, API with controllers, services folder, tests, etc... In each file there's a short instruction of what should be included in the current file/folder. Some of the files are optional or just sample files and can/should be deleted.

License

MM-NODE-CLI is MIT licensed, as found in the LICENSE file.