yargs/yargs

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

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Yargs

Build Status Coverage Status NPM version Windows Tests js-standard-style Conventional Commits Slack

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:

Installation
i yargs --save
Simple Example
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!
Complex Example
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.

Table of Contents

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.