1 # meow [![Build Status](https://travis-ci.org/sindresorhus/meow.svg?branch=master)](https://travis-ci.org/sindresorhus/meow)
10 - Parses arguments using [minimist](https://github.com/substack/minimist)
11 - Converts flags to [camelCase](https://github.com/sindresorhus/camelcase)
12 - Outputs version when `--version`
13 - Outputs description and supplied help text when `--help`
14 - Makes unhandled rejected promises [fail loudly](https://github.com/sindresorhus/loud-rejection) instead of the default silent fail
15 - Sets the process title to the binary name defined in package.json
21 $ npm install --save meow
28 $ ./foo-app.js unicorns --rainbow-cake
34 const meow = require('meow');
35 const foo = require('./');
42 -r, --rainbow Include a rainbow
45 $ foo unicorns --rainbow
55 flags: {rainbow: true},
60 foo(cli.input[0], cli.flags);
66 ### meow(options, [minimistOptions])
68 Returns an object with:
70 - `input` *(array)* - Non-flag arguments
71 - `flags` *(object)* - Flags converted to camelCase
72 - `pkg` *(object)* - The `package.json` object
73 - `help` *(object)* - The help text used with `--help`
74 - `showHelp([code=0])` *(function)* - Show the help text and exit with `code`
78 Type: `object`, `array`, `string`
80 Can either be a string/array that is the `help` or an options object.
84 Type: `string`, `boolean`
85 Default: The package.json `"description"` property
87 A description to show above the help text.
89 Set it to `false` to disable it altogether.
93 Type: `string`, `boolean`
95 The help text you want shown.
97 The input is reindented and starting/ending newlines are trimmed which means you can use a [template literal](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/template_strings) without having to care about using the correct amount of indent.
99 <del>If it's an array each item will be a line.</del>
100 *(Still supported, but you should use a template literal instead.)*
102 The description will be shown above your help text automatically.
104 Set it to `false` to disable it altogether.
108 Type: `string`, `boolean`
109 Default: The package.json `"version"` property
111 Set a custom version output.
113 Set it to `false` to disable it altogether.
117 Type: `string`, `object`
118 Default: Closest package.json upwards
120 Relative path to package.json or as an object.
125 Default: `process.argv.slice(2)`
127 Custom arguments object.
134 Minimist [options](https://github.com/substack/minimist#var-argv--parseargsargs-opts).
136 Keys passed to the minimist `default` option are [decamelized](https://github.com/sindresorhus/decamelize), so you can for example pass in `fooBar: 'baz'` and have it be the default for the `--foo-bar` flag.
141 Meow will make unhandled rejected promises [fail loudly](https://github.com/sindresorhus/loud-rejection) instead of the default silent fail. Meaning you don't have to manually `.catch()` promises used in your CLI.
146 See [`chalk`](https://github.com/chalk/chalk) if you want to colorize the terminal output.
148 See [`get-stdin`](https://github.com/sindresorhus/get-stdin) if you want to accept input from stdin.
150 See [`update-notifier`](https://github.com/yeoman/update-notifier) if you want update notifications.
152 See [`configstore`](https://github.com/yeoman/configstore) if you need to persist some data.
154 [More useful CLI utilities.](https://github.com/sindresorhus/awesome-nodejs#command-line-utilities)
159 MIT © [Sindre Sorhus](http://sindresorhus.com)