mri icon indicating copy to clipboard operation
mri copied to clipboard

Quickly scan for CLI flags and arguments

Results 8 mri issues
Sort by recently updated
recently updated
newest added

```js #!/usr/bin/env node const mri = require('mri') console.log(process.argv) console.log(mri(process.argv.slice(2))) ``` ```shell ./args.js -a -b '-c foo' ``` ```js [ '/usr/local/Cellar/node/16.0.0_1/bin/node', '/Users/j/web/pev2-cli/foo.js', '-a', '-b', '-c foo' ] { _: [], a:...

```js // x.js import minimist from "minimist" import mri from "mri" const OPTIONS = { boolean: [ 'flag' ], array: [ { key: '_', number: true } ] } console.log('minimist',...

Hi Luke, I'm pretty naive in the node.js and all the surrounding infrastructure (I have been programming mostly in C++, Haskell, Ocaml, C#, F# and Bash during the last 20...

I'm using `[email protected]`. ```js const headerAliased = {alias: {H: 'header'}} mri(['-H', 'one', '--header=two']) // as expected: { _: [], H: 'one', header: 'two' } mri(['-H', 'one', '--header', 'two']) // as...

https://twitter.com/ljharb/status/1579610529337049088?s=20&t=s4t-6WoFHbjQVGHhn_ZBEw

When I have a config like `{ boolean: ["foo"], string: ["foo"] }`, I expect that passing `--foo` (without any values) to return `true` in the parsed object. Below shows the...

This PR improves the type of Argv using generics. ## Changes - Removed internal `Default` type - Added new internal `Simplify` type utility to keep the IDE hover type display...

```js import mri from "mri"; const parsed = mri(process.argv.slice(2), { string: ["foo", "bar"], alias: { f: "foo" }, unknown(flag) { console.error(`Unknown flag: ${flag}`); process.exit(1); }, }); console.log(parsed); ``` Then run...