Helpful CLI usage printer
Built with ❤︎ by Tiaan and contributors
Simple CLI utility module for printing usage info to console or stream.
$ npm install --save print-usage
# OR
$ yarn add print-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)
printUsage(arrayOfUsages, options)
module exports single function that returns object with print
, set
& get
property functions. See example.
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.
Licensed under the MIT License.