node-minecraft-protocol
node-minecraft-protocol copied to clipboard
consider using minimist for options parsing in proxy example
https://www.npmjs.com/package/minimist
Example https://github.com/feross/webtorrent-cli/blob/master/bin/cmd.js#L38 and maybe https://github.com/feross/webtorrent-cli/blob/master/bin/cmd.js#L167 (using es6 templates instead)
https://www.npmjs.com/package/commander is also a really nice module for cli argument parsing:
var program = require('commander');
program
.version('0.0.1')
.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')
.parse(process.argv);
console.log('you ordered a pizza with:');
if (program.peppers) console.log(' - peppers');
if (program.pineapple) console.log(' - pineapple');
if (program.bbqSauce) console.log(' - bbq');
console.log(' - %s cheese', program.cheese);
Sorry I'm a bit late to the issue party, but you could also use my more lightweight package, gar. https://github.com/ethanent/gar