3 ms·
Semi-related: if you write CLI tools with nodejs, I highly recommend using yargs and/or inquirer - yargs for robust command line arguments parsing, and inquirer
by jakub_g 10y ago
Semi-related: if you write CLI tools with nodejs, I highly recommend using yargs and/or inquirer - yargs for robust command line arguments parsing, and inquirer for interactively asking questions to the user.
https://github.com/yargs/yargs https://github.com/yargs/yargs
https://github.com/SBoudrias/Inquirer.js/ https://github.com/SBoudrias/Inquirer.js/
When using these tools correctly (following readme), you get most of the stuff written in the article out of the box.
- paulddraper 10y agoEw. Most programs shouldn't ask me questions. They should print a usage statement if I haven't provided enough info.
- flukus 10y agoYep, they're commands, not conversations.
- sotojuan 10y agoAnd if you want something a bit above yargs (and to prove the point of JS having many solutions to everything!) use `meow`: https://github.com/sindresorhus/meow https://github.com/sindresorhus/meow
- justsee 10y agocli-kit is rather comprehensive, well-thought out, and modular too if you're looking for Node options: https://github.com/cli-kit/cli-toolkit https://github.com/cli-kit/cli-toolkit