The Node.js and JavaScript ecosystem is very vast and therefore very interesting for building CLI (command line interface) tools.
These tools are very commonly used and developed to simplify the life of developers and integrators in various projects. Many frameworks and libraries have their own CLI to offer developers an optimal experience. We use them every day (sometimes without even realizing it).
I often recommend to the beginner to discover Node.js by building a CLI (for example a small RPG game in text format playable with commands... it's really an idea of a small project that pushes you to improve your level of mastery in JavaScript).
If you want to get started, I recommend this little guide or also Create a command line tool (french) which will teach you how to set up a simple CLI. Also I recommend you to read the npm link doc as well as the doc on the bin field of the package.json.
Other resources (talks and articles) on the subject:
- Building Great CLI Experiences in Node
- Building Interactive npm Command Line Modules
- CLI Tools for All the Things
- My list of awesome crafted packages CLI
- Node.js CLI Apps Best Practices
Some packages I recommend:
- kleur (for color text in the terminal, there is also chalk).
- inquirer.js (there is also enquirer).
- cliui
- sade
- boxen
- Elegant terminal spinner
- gauge
- @topcli/prompts
If you ever want to see a concrete case I invite you to look at the CLI of one of my projects Node-secure or npq of Liran tal.
⬅️ 🐢 Node.js: 👽 Native API (native addon creation in C and C++) | ➡️ 🐢 Node.js: 📦 Packages