Name: yargs
Owner: yargs
Description: yargs the modern, pirate-themed successor to optimist.
Created: 2013-11-07 17:25:51.0
Updated: 2018-01-19 14:05:38.0
Pushed: 2018-01-18 20:10:38.0
Homepage: http://yargs.js.org/
Size: 2158
Language: JavaScript
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
Having problems? want to contribute? join our community slack.
Yargs be a node.js library fer hearties tryin' ter parse optstrings.
Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface. It gives you:
my-program.js serve --port=5000
).i yargs --save
sr/bin/env node
t argv = require('yargs').argv
argv.ships > 3 && argv.distance < 53.5) {
nsole.log('Plunder more riffiwobbles!')
se {
nsole.log('Retreat from the xupptumblers!')
ash
plunder.js --ships=4 --distance=22
der more riffiwobbles!
plunder.js --ships 12 --distance 98.7
eat from the xupptumblers!
sr/bin/env node
ire('yargs') // eslint-disable-line
ommand('serve [port]', 'start the server', (yargs) => {
yargs
.positional('port', {
describe: 'port to bind on',
default: 5000
})
(argv) => {
if (argv.verbose) console.info(`start server on :${argv.port}`)
serve(argv.port)
ption('verbose', {
alias: 'v',
default: false
rgv
Run the example above with --help
to see the help for the application.