{"_id":"@cjser/meow__v10_1_5","name":"@cjser/meow__v10_1_5","dist-tags":{"latest":"10.1.5-cjser.2"},"versions":{"10.1.5-cjser.2":{"name":"@cjser/meow__v10_1_5","version":"10.1.5-cjser.2","description":"CLI app helper","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"require":"./dist-cjser/index.cjs","default":"./index.js"},"engines":{"node":"^12.20.0 || ^14.13.1 || >=16.0.0"},"scripts":{"test":"xo && ava && tsd"},"keywords":["cli","bin","util","utility","helper","argv","command","line","meow","cat","kitten","parser","option","flags","input","cmd","console"],"dependencies":{"@types/minimist":"^1.2.2","camelcase-keys":"^7.0.0","decamelize":"^5.0.0","decamelize-keys":"^1.1.0","hard-rejection":"^2.1.0","minimist-options":"4.1.0","normalize-package-data":"^3.0.2","type-fest":"^1.2.2","yargs-parser":"^20.2.9","@cjser/read-pkg-up__v8_0_0":"8.0.0-cjser.2","@cjser/redent":"4.0.0-cjser.2","@cjser/trim-newlines__v4_1_1":"4.1.1-cjser.2"},"devDependencies":{"ava":"^3.15.0","execa":"^6.1.0","indent-string":"^5.0.0","read-pkg":"^7.1.0","tsd":"^0.20.0","xo":"^0.48.0"},"xo":{"rules":{"unicorn/no-process-exit":"off"}},"ava":{"files":["test/*"]},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"10.1.5","cjserVersion":2,"original":{"name":"meow","version":"10.1.5","exports":"./index.js","repository":"sindresorhus/meow","dependencies":{"@types/minimist":"^1.2.2","camelcase-keys":"^7.0.0","decamelize":"^5.0.0","decamelize-keys":"^1.1.0","hard-rejection":"^2.1.0","minimist-options":"4.1.0","normalize-package-data":"^3.0.2","read-pkg-up":"^8.0.0","redent":"^4.0.0","trim-newlines":"^4.0.2","type-fest":"^1.2.2","yargs-parser":"^20.2.9"},"files":["index.js","index.d.ts"],"scripts":{"test":"xo && ava && tsd"}}},"_id":"@cjser/meow__v10_1_5@10.1.5-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-lBPxC5mXy/+09O71evPhwpv8goMR3dR7muh7IPtP8758I8B8olGdCj1z8MIlgGyWq1QRdfqr8Q4FijIo7ya2CA==","shasum":"fbcca84988b0b6518b7e40ff3467857fd5d5307d","tarball":"https://registry.npmjs.org/@cjser/meow__v10_1_5/-/meow__v10_1_5-10.1.5-cjser.2.tgz","fileCount":6,"unpackedSize":35796,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCmBZe8wwi73Lf8jKZ9UyQ5MnIMTj5OOGdzzhFV8J7I0wIhANUACDNIICS9f3x4F81RvI7I3YLbaQgI0y12F3fxxbgD"}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/meow__v10_1_5_10.1.5-cjser.2_1778159047732_0.7330017866588776"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:04:07.621Z","10.1.5-cjser.2":"2026-05-07T13:04:07.919Z","modified":"2026-05-07T13:04:08.139Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"CLI app helper","keywords":["cli","bin","util","utility","helper","argv","command","line","meow","cat","kitten","parser","option","flags","input","cmd","console"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","readme":"# meow\n\n> CLI app helper\n\n![](meow.gif)\n\n*I would recommend reading this [guide](https://clig.dev) on how to make user-friendly command-line tools.*\n\n## Features\n\n- Parses arguments\n- Converts flags to [camelCase](https://github.com/sindresorhus/camelcase)\n- Negates flags when using the `--no-` prefix\n- Outputs version when `--version`\n- Outputs description and supplied help text when `--help`\n- Makes unhandled rejected promises [fail hard](https://github.com/sindresorhus/hard-rejection) instead of the default silent fail\n- Sets the process title to the binary name defined in package.json\n\n## Install\n\n```\n$ npm install meow\n```\n\n## Usage\n\n```\n$ ./foo-app.js unicorns --rainbow\n```\n\n```js\n#!/usr/bin/env node\nimport meow from 'meow';\nimport foo from './lib/index.js';\n\nconst cli = meow(`\n\tUsage\n\t  $ foo <input>\n\n\tOptions\n\t  --rainbow, -r  Include a rainbow\n\n\tExamples\n\t  $ foo unicorns --rainbow\n\t  🌈 unicorns 🌈\n`, {\n\timportMeta: import.meta,\n\tflags: {\n\t\trainbow: {\n\t\t\ttype: 'boolean',\n\t\t\talias: 'r'\n\t\t}\n\t}\n});\n/*\n{\n\tinput: ['unicorns'],\n\tflags: {rainbow: true},\n\t...\n}\n*/\n\nfoo(cli.input[0], cli.flags);\n```\n\n## API\n\n### meow(helpText, options?)\n### meow(options)\n\nReturns an `object` with:\n\n- `input` *(Array)* - Non-flag arguments\n- `flags` *(Object)* - Flags converted to camelCase excluding aliases\n- `unnormalizedFlags` *(Object)* - Flags converted to camelCase including aliases\n- `pkg` *(Object)* - The `package.json` object\n- `help` *(string)* - The help text used with `--help`\n- `showHelp([exitCode=2])` *(Function)* - Show the help text and exit with `exitCode`\n- `showVersion()` *(Function)* - Show the version text and exit\n\n#### helpText\n\nType: `string`\n\nShortcut for the `help` option.\n\n#### options\n\nType: `object`\n\n##### importMeta\n\nType: `object`\n\nPass in [`import.meta`](https://nodejs.org/dist/latest/docs/api/esm.html#esm_import_meta). This is used to find the correct package.json file.\n\n##### flags\n\nType: `object`\n\nDefine argument flags.\n\nThe key is the flag name in camel-case and the value is an object with any of:\n\n- `type`: Type of value. (Possible values: `string` `boolean` `number`)\n- `alias`: Usually used to define a short flag alias.\n- `default`: Default value when the flag is not specified.\n- `isRequired`: Determine if the flag is required. (Default: false)\n\t- If it's only known at runtime whether the flag is required or not, you can pass a `Function` instead of a `boolean`, which based on the given flags and other non-flag arguments, should decide if the flag is required. Two arguments are passed to the function:\n\t- The first argument is the **flags** object, which contains the flags converted to camel-case excluding aliases.\n\t- The second argument is the **input** string array, which contains the non-flag arguments.\n\t- The function should return a `boolean`, true if the flag is required, otherwise false.\n- `isMultiple`: Indicates a flag can be set multiple times. Values are turned into an array. (Default: false)\n\t- Multiple values are provided by specifying the flag multiple times, for example, `$ foo -u rainbow -u cat`. Space- or comma-separated values are [currently *not* supported](https://github.com/sindresorhus/meow/issues/164).\n\nNote that flags are always defined using a camel-case key (`myKey`), but will match arguments in kebab-case (`--my-key`).\n\nExample:\n\n```js\nflags: {\n\tunicorn: {\n\t\ttype: 'string',\n\t\talias: 'u',\n\t\tdefault: ['rainbow', 'cat'],\n\t\tisMultiple: true,\n\t\tisRequired: (flags, input) => {\n\t\t\tif (flags.otherFlag) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}\n\t}\n}\n```\n\n##### description\n\nType: `string | boolean`\\\nDefault: The package.json `\"description\"` property\n\nDescription to show above the help text.\n\nSet it to `false` to disable it altogether.\n\n##### help\n\nType: `string | boolean`\n\nThe help text you want shown.\n\nThe 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.\n\nThe description will be shown above your help text automatically.\n\n##### version\n\nType: `string | boolean`\\\nDefault: The package.json `\"version\"` property\n\nSet a custom version output.\n\n##### autoHelp\n\nType: `boolean`\\\nDefault: `true`\n\nAutomatically show the help text when the `--help` flag is present. Useful to set this value to `false` when a CLI manages child CLIs with their own help text.\n\nThis option is only considered when there is only one argument in `process.argv`.\n\n##### autoVersion\n\nType: `boolean`\\\nDefault: `true`\n\nAutomatically show the version text when the `--version` flag is present. Useful to set this value to `false` when a CLI manages child CLIs with their own version text.\n\n This option is only considered when there is only one argument in `process.argv`.\n\n##### pkg\n\nType: `object`\\\nDefault: Closest package.json upwards\n\npackage.json as an `object`.\n\n*You most likely don't need this option.*\n\n##### argv\n\nType: `string[]`\\\nDefault: `process.argv.slice(2)`\n\nCustom arguments object.\n\n##### inferType\n\nType: `boolean`\\\nDefault: `false`\n\nInfer the argument type.\n\nBy default, the argument `5` in `$ foo 5` becomes a string. Enabling this would infer it as a number.\n\n##### booleanDefault\n\nType: `boolean | null | undefined`\\\nDefault: `false`\n\nValue of `boolean` flags not defined in `argv`.\n\nIf set to `undefined`, the flags not defined in `argv` will be excluded from the result.\nThe `default` value set in `boolean` flags take precedence over `booleanDefault`.\n\n_Note: If used in conjunction with `isMultiple`, the default flag value is set to `[]`._\n\n__Caution: Explicitly specifying `undefined` for `booleanDefault` has different meaning from omitting key itself.__\n\nExample:\n\n```js\nimport meow from 'meow';\n\nconst cli = meow(`\n\tUsage\n\t  $ foo\n\n\tOptions\n\t  --rainbow, -r  Include a rainbow\n\t  --unicorn, -u  Include a unicorn\n\t  --no-sparkles  Exclude sparkles\n\n\tExamples\n\t  $ foo\n\t  🌈 unicorns✨🌈\n`, {\n\timportMeta: import.meta,\n\tbooleanDefault: undefined,\n\tflags: {\n\t\trainbow: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true,\n\t\t\talias: 'r'\n\t\t},\n\t\tunicorn: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\talias: 'u'\n\t\t},\n\t\tcake: {\n\t\t\ttype: 'boolean',\n\t\t\talias: 'c'\n\t\t},\n\t\tsparkles: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: true\n\t\t}\n\t}\n});\n/*\n{\n\tflags: {\n\t\trainbow: true,\n\t\tunicorn: false,\n\t\tsparkles: true\n\t},\n\tunnormalizedFlags: {\n\t\trainbow: true,\n\t\tr: true,\n\t\tunicorn: false,\n\t\tu: false,\n\t\tsparkles: true\n\t},\n\t…\n}\n*/\n```\n\n##### hardRejection\n\nType: `boolean`\\\nDefault: `true`\n\nWhether to use [`hard-rejection`](https://github.com/sindresorhus/hard-rejection) or not. Disabling this can be useful if you need to handle `process.on('unhandledRejection')` yourself.\n\n##### allowUnknownFlags\n\nType `boolean`\\\nDefault: `true`\n\nWhether to allow unknown flags or not.\n\n## Promises\n\nMeow will make unhandled rejected promises [fail hard](https://github.com/sindresorhus/hard-rejection) instead of the default silent fail. Meaning you don't have to manually `.catch()` promises used in your CLI.\n\n## Tips\n\nSee [`chalk`](https://github.com/chalk/chalk) if you want to colorize the terminal output.\n\nSee [`get-stdin`](https://github.com/sindresorhus/get-stdin) if you want to accept input from stdin.\n\nSee [`conf`](https://github.com/sindresorhus/conf) if you need to persist some data.\n\nSee [`update-notifier`](https://github.com/yeoman/update-notifier) if you want update notifications.\n\n[More useful CLI utilities…](https://github.com/sindresorhus/awesome-nodejs#command-line-utilities)\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-meow?utm_source=npm-meow&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/meow\n","readmeFilename":"readme.md","_rev":"1-5285abef8dd8b882a2f1371204faba28"}