Name: yargs
Owner: Prisma
Description: yargs the modern, pirate-themed successor to optimist.
Forked from: yargs/yargs
Created: 2017-07-27 12:43:57.0
Updated: 2017-07-27 12:43:59.0
Pushed: 2017-08-21 00:56:04.0
Homepage: http://yargs.js.org/
Size: 1922
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', 'start the server', (yargs) => {
yargs.option('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.