butterscotch-pudding
Create figgy-pudding instances from yargs options
One day, long ago, it was Talk Like A Pirate Day and Butterscotch Pudding Day.
Install
$ npm install butterscotch-pudding
Usage
const bp = require('butterscotch-pudding');
const yargs = require('yargs/yargs');
const opts = {
ships: {
type: 'number',
default: 3,
},
distance: {
type: 'number',
},
color: {
type: 'string',
defaultDescription: 'butterscotch',
},
};
const CommandOptions = bp(opts);
const argv = yargs().options(opts).parse('--distance 100 --color chartreuse --cutlass');
const opts = CommandOptions(argv);
opts.get('ships');
opts.get('color');
opts.get('cutlass');
API