{"library":"meow","title":"Meow CLI Helper","description":"Meow is a minimalist and dependency-free helper library designed for creating command-line interface (CLI) applications in Node.js. It simplifies argument parsing, flag handling, and generation of help and version output. Currently stable at version 14.1.0, Meow maintains an active release cadence, often aligning major versions with Node.js LTS releases to keep up with runtime changes. Its key differentiators include automatic conversion of flags to camelCase, support for `--no-` prefix flag negation, and built-in `--version` and `--help` handling. Since version 12, Meow has been ESM-only, requiring modern Node.js module syntax and an `import.meta` object for package metadata resolution. Recent additions include robust subcommand parsing via the `commands` option and the ability to make input arguments required. It's an opinionated, lightweight choice for CLI parsing.","language":"javascript","status":"active","last_verified":"Wed Apr 22","install":{"commands":["npm install meow"],"cli":{"name":"meow","version":null}},"imports":["import meow from 'meow';","import type { AnyFlag } from 'meow';","import type { AnyFlags } from 'meow';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"#!/usr/bin/env node\nimport meow from 'meow';\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, // This is required for meow to find package.json\n\tflags: {\n\t\trainbow: {\n\t\t\ttype: 'boolean',\n\t\t\tshortFlag: 'r'\n\t\t}\n\t}\n});\n\n// Example usage with parsed input and flags\nconst inputArgument = cli.input.at(0);\nconst enableRainbow = cli.flags.rainbow;\n\nif (inputArgument) {\n  const message = enableRainbow ? `🌈 ${inputArgument} 🌈` : inputArgument;\n  console.log(message);\n} else {\n  console.log('No input provided. Try: foo unicorns --rainbow');\n  cli.showHelp();\n}\n","lang":"typescript","description":"This example demonstrates basic CLI setup with `meow`, parsing a main input argument and a boolean flag, and printing a message. It includes the mandatory `import.meta` option.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}