5 This module is the guts of optimist's argument parser without all the
8 [![browser support](https://ci.testling.com/substack/minimist.png)](http://ci.testling.com/substack/minimist)
10 [![build status](https://secure.travis-ci.org/substack/minimist.png)](http://travis-ci.org/substack/minimist)
15 var argv = require('minimist')(process.argv.slice(2));
20 $ node example/parse.js -a beep -b boop
21 { _: [], a: 'beep', b: 'boop' }
25 $ node example/parse.js -x 3 -y 4 -n5 -abc --beep=boop foo bar baz
26 { _: [ 'foo', 'bar', 'baz' ],
39 var parseArgs = require('minimist')
42 ## var argv = parseArgs(args, opts={})
44 Return an argument object `argv` populated with the array arguments from `args`.
46 `argv._` contains all the arguments that didn't have an option associated with
49 Numeric-looking arguments will be returned as numbers unless `opts.string` or
50 `opts.boolean` is set for that argument name.
52 Any arguments after `'--'` will not be parsed and will end up in `argv._`.
56 * `opts.string` - a string or array of strings argument names to always treat as
58 * `opts.boolean` - a string or array of strings to always treat as booleans
59 * `opts.alias` - an object mapping string names to strings or arrays of string
60 argument names to use as aliases
61 * `opts.default` - an object mapping string argument names to default values
65 With [npm](https://npmjs.org) do: