This package has been deprecated

Author message:

Use minimist, optimist, or enquirer

zrgs

2.0.5 • Public • Published

zrgs

Tiny cli args module.

Support with PayPal Patreon ko-fi


Installation

npm i zrgs

Usage

zrgs does the bare minimum. It's just a couple of helper functions. If you want an interactive CLI library, automatic help/usage, configurable aliases, complex arguments, or any other nice features, you should probably use a different library.

zrgs assumes you want short, long, and GNU-style long flags. hasFlag('foo') will return true if the first argument is -f, -foo, or --foo. args is process.argv.slice(2). And that's it.

const { hasFlag, args } = require('zrgs')
 
if (hasFlag('help')) {
  // display help
} else if (hasFlag('something')) {
  handleSomething(args)
}

LICENSE

Package Sidebar

Install

npm i zrgs

Weekly Downloads

2

Version

2.0.5

License

LGPL-3.0

Unpacked Size

13.5 kB

Total Files

12

Last publish

Collaborators

  • zacanger