{"_id":"@cjser/meow__v12_1_1","name":"@cjser/meow__v12_1_1","dist-tags":{"latest":"12.1.1-cjser.2"},"versions":{"12.1.1-cjser.2":{"name":"@cjser/meow__v12_1_1","version":"12.1.1-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":{"types":"./build/index.d.ts","require":"./dist-cjser/index.cjs","default":"./build/index.js"},"sideEffects":false,"engines":{"node":">=16.10"},"scripts":{"build":"rollup --config","test":"xo && npm run build && ava && tsd --typings build/index.d.ts"},"keywords":["cli","bin","util","utility","helper","argv","command","line","meow","cat","kitten","parser","option","flags","input","cmd","console"],"devDependencies":{"@rollup/plugin-commonjs":"^25.0.3","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.1.0","@types/minimist":"^1.2.2","ava":"^5.3.1","camelcase-keys":"^8.0.2","common-tags":"^2.0.0-alpha.1","decamelize":"^6.0.0","decamelize-keys":"^2.0.1","delete_comments":"^0.0.2","execa":"^7.2.0","globby":"^13.2.2","hard-rejection":"^2.1.0","indent-string":"^5.0.0","minimist-options":"4.1.0","normalize-package-data":"^5.0.0","read-pkg":"^8.0.0","read-pkg-up":"^10.0.0","redent":"^4.0.0","rollup":"^3.27.0","rollup-plugin-dts":"^6.0.0","rollup-plugin-license":"^3.0.1","trim-newlines":"^5.0.0","tsd":"^0.28.1","type-fest":"^4.3.1","typescript":"~5.1.6","xo":"^0.56.0","yargs-parser":"^21.1.1"},"xo":{"rules":{"unicorn/no-process-exit":"off","unicorn/error-message":"off"},"ignores":["build"]},"ava":{"files":["test/*"]},"types":"./build/index.d.ts","main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"12.1.1","cjserVersion":2,"original":{"name":"meow","version":"12.1.1","exports":{"types":"./build/index.d.ts","default":"./build/index.js"},"repository":"sindresorhus/meow","files":["build"],"scripts":{"prepare":"npm run build","build":"rollup --config","test":"xo && npm run build && ava && tsd --typings build/index.d.ts"}}},"_id":"@cjser/meow__v12_1_1@12.1.1-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-SREzOuPSnJ09uRqmx+khY3qn8gG6CBBXLVmW00kBClmg1/nbishooqJUxIAJWbDu/1sHiUbyrwwbwPTZjDbz/w==","shasum":"5039c59369a5d8ecedbc8a0d76fffea76dd4fd24","tarball":"https://registry.npmjs.org/@cjser/meow__v12_1_1/-/meow__v12_1_1-12.1.1-cjser.2.tgz","fileCount":12,"unpackedSize":844451,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDROCoIE08Zi9b5r0TkuaFtqk4zm8ms2fSfK+1l0VCzJgIgBTqHhX5g6FNhuhk/HlZGCGrU8YeqChE+Sb18JS1AW7c="}]},"_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__v12_1_1_12.1.1-cjser.2_1778159053822_0.07175503522347348"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:04:13.675Z","12.1.1-cjser.2":"2026-05-07T13:04:14.050Z","modified":"2026-05-07T13:04:14.369Z"},"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- No dependencies!\n\n## Install\n\n```sh\nnpm install meow\n```\n\n## Usage\n\n```sh\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\tshortFlag: 'r'\n\t\t}\n\t}\n});\n/*\n{\n\tinput: ['unicorns'],\n\tflags: {rainbow: true},\n\t...\n}\n*/\n\nfoo(cli.input.at(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- `choices`: Limit valid values to a predefined set of choices.\n- `default`: Default value when the flag is not specified.\n- `shortFlag`: A short flag alias.\n- `aliases`: Other names for the flag.\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- `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\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\tchoices: ['rainbow', 'cat', 'unicorn'],\n\t\tdefault: ['rainbow', 'cat'],\n\t\tshortFlag: 'u',\n\t\taliases: ['unicorns'],\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\nThis 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\nNote: Setting this stops `meow` from finding a package.json.\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\tshortFlag: 'r'\n\t\t},\n\t\tunicorn: {\n\t\t\ttype: 'boolean',\n\t\t\tdefault: false,\n\t\t\tshortFlag: 'u'\n\t\t},\n\t\tcake: {\n\t\t\ttype: 'boolean',\n\t\t\tshortFlag: '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\n[More useful CLI utilities…](https://github.com/sindresorhus/awesome-nodejs#command-line-utilities)\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-73147013628eaae32d31c5dbeb2098b7"}