1.1.0 • Published 3 years ago

@gness1804/create-node-cli v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@gness1804/create-node-cli

A scaffolding tool to create production-ready Node CLIs.

Why

This is a handy tool to create new Node.js CLIs. It allows a user to quickly create a production-ready Node.js app with a standard file structure. It seeks to strike a balance between being opinionated on some important issues and letting the user architect the project as they see fit. Of course, what is generated can be modified as desired.

This package is based on Ahmad Awais's npm package of the same name. It contains most features of the original app plus a few new goodies:

  • Select your preferred package manager (npm or yarn).
  • Choose whether to generate your new module with ECMAScript Modules (ESM) or CommonJS.
  • Support for ESlint as well as Prettier, including package.json scripts and config files with sensible defaults.
  • Generates a README.md template that includes important points for a production release.
  • Allows user to choose a Node version to include in a .nvmrc file.
  • Written using ESM.

Install

npm install -g @gness1804/create-node-cli OR yarn global add @gness1804/create-node-cli
OR
npx @gness1804/create-node-cli

Basic Usage

create-node-cli <command> [option]
ncli <command> [option]

COMMANDS

help  Print help info.

OPTIONS

-d, --debug    Print debug info Default: false
-v, --version  Print CLI version Default: false

QUESTIONS

The app will prompt you for the following:

✔ Preferred package manager? · npm / yarn
✔ Use ESM (ECMAScript Modules) or CommonJS? · commonjs / esm
✔ Name of your CLI? · my-cli
✔ CLI command? run-cli
✔ Description of your CLI? · a good cli
✔ Version of your CLI? · 0.1.1
✔ node version for .nvmrc? · 14.16.1
✔ Name of the author? · Graham Nessler

For details on the original package on which this is built, see the original create-node-cli.

Debugging Package Creation

If you clone down and run this package, you might want to easily be able to create and destroy "test" child packages--for instance, to test if a particular feature is working. I've included a handy way to remove such packages created for experimental purposes. If you namespace a package with dirtest, then you can run npm run clean or yarn clean, and it will prompt you to confirm that you wish to delete all test packages (with this namespace). If you confirm, they will be removed.

Changelog

❯ Read the changelog here →