1
0
mirror of https://github.com/onkelbeh/cheatsheets.git synced 2025-10-16 23:47:47 +02:00
cheatsheets/meow.md
Rico Sta. Cruz 6e2a22b82b Update
2016-01-07 12:47:48 +08:00

612 B

title, category
title category
Meow JavaScript libraries
const cli = require('meow')(`
  Usage: appname [options]

  Options:
    -h, --help       show usage information
    -v, --version    print version info and exit
`, {
  alias: { h: 'help', v: 'version', x: 'excludeTag' },
  string: ['lang'],
  boolean: ['pager'],
  default: { lang: 'en' },
  '--': true,
  stopEarly: true, /* populate _ with first non-option */
  unknown: function () { ... } /* invoked on unknown param */
})

cli.flags   // { excludeTag: true }
cli.input   // []

// yes, flags are camelCased

Also see minimist.