3.0.0 • Published 7 years ago

commandy v3.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

commandy

Build Status dependencies Status devDependencies Status PRs Welcome npm Downloads

If you want to create a command line app which is hard to make with minimist, but don't want the syntactic sugar overdose which commander.js gives, this package is for you.

Demo

const {Program} = require('../');

const checkoutProgram = new Program();

const orderProgram = new Program([
	['p', 'pepperoni'],
	['c', 'cheese'],
	['h', 'ham']
])

const pizzaProgram = new Program({
	checkout: checkoutProgram,
	order: orderProgram
});

const margaretaCheckout = pizzaProgram.parse(['checkout','margareta']);
console.log(margaretaCheckout.program === checkoutProgram);
// => true
console.log(margaretaCheckout.args)
// => [ 'margareta' ]

const order = pizzaProgram.parse(['order','-ch','hawaii','-c','--pepperoni=little'])
console.log(order.args);
// => [ 'hawaii' ]
console.log(order.options.cheese);
// => [ true, true ]
console.log(order.options.ham);
// => [ true ]
console.log(order.options.pepperoni);
// => [ 'little' ]

Installation

npm install commandy --save

3.0.0

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.6

7 years ago

1.1.5

7 years ago

1.1.4

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.1

7 years ago