Dark is currently in development. It's on the fast track to a 1.0 release, so we encourage you to use it and give us your feedback, but there are things that haven't been finalized yet and you can expect some changes.
Dark is a fork of commander.js with the following goals:
- Customizability: Users can override the built in templates (.i.e default help prompt template) by importing templates
- Type Safe: Improved compatibility with type systems
- Improved Documentation: Provide a plethora of examples along with high quality API docs
- Coloring: Built in support for colored output
npm install dark
- Build your CLI app:
// index.js
const { default: dark } = require('dark');
const program = dark()
.version('0.1.0')
.option('-p, --peppers', 'Add peppers')
.option('-P, --pineapple', 'Add pineapple')
.option('-b, --bbq-sauce', 'Add bbq sauce')
.option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')
.init();
console.log('you ordered a pizza with:');
if (program.get('peppers')) console.log(' - peppers');
if (program.get('pineapple')) console.log(' - pineapple');
if (program.get('bbqSauce')) console.log(' - bbq');
console.log(' - %s cheese', program.get('cheese'));
- Run it:
node index.js -c # cheese
node index.js -c -p # cheese and peppers
node index.js --cheese --peppers # cheese and peppers
See the API docs
Do you like this project? Star the repository, spread the word - it really helps. You may want to follow me on Twitter and GitHub. Thanks!
If this project is saving you (or your team) time, please consider supporting it on Patreon 👍 thank you!