yargs-get-help1.1.1 • Public • Published
Get the help output from a yargs instance.
This module is very handy when you are developing tests for a project that has a CLI, specially when used in conjunction with snapshot testing.
$ npm install yargs-get-help
;;yargs;const help = ;// `help` will contain yargs `$0 --help` output as a string
getHelp(yargs, [args], [options])
;;yargs;const help = ;// `help` will contain yargs `$0 serve --help` output as a string
normalize: Normalizes the output, unifying things like terminal sizes, locale, $0 and ansi-codes (defaults to
NOTE: This package mutates the passed
yargs instance. If this is a problem, please consider using yargs/yargs instead.
$ npm test
$ npm test -- --watch during development