1.0.0 • Published 7 years ago

print-usage v1.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

About

Simple CLI utility module for printing usage info to console or stream.

Install

$ npm install --save print-usage
# OR
$ yarn add print-usage

Usage

const printUsage = require('print-usage')

const dummy = [
  {flags: ['--foo', '-f'], alias: '-b', description: 'Does the things', default: '55'},
  {flags: ['--bar', '--baz'], alias: '-b', description: 'Does the other things'},
  {flags: ['--baz'], description: 'Does nothing', default: 'foo'}
]

const test = printUsage(dummy)
test.print()
//    --foo, -f, -b            Does the things (default: 55)
//    --bar, --baz, -b         Does the other things
//    --baz                    Does nothing (default: foo)

API

printUsage(arrayOfUsages, options)

module exports single function that returns object with print, set & get property functions. See example.

Contribute

Contributions are welcome. Please open up an issue or create PR if you would like to help out.

Note: If editing the README, please conform to the standard-readme specification.

License

Licensed under the MIT License.

1.0.0

7 years ago