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.
npm install meowVerified import paths — ran on the pinned version, not inferred.
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.
Upgrade your Node.js environment to version 20 or higher. Consider using a Node.js version manager (e.g., `nvm` or `volta`) to manage different project requirements.
Migrate your project to use ESM syntax (`import`/`export`) and ensure your `package.json` includes `"type": "module"`. For TypeScript, configure `"module": "node16"` or `"nodenext"` in `tsconfig.json`.
Update flag definitions from `alias: 'x'` to `shortFlag: 'x'` in your `meow` configuration. If you intended to have multiple aliases, use the new `aliases` option.
Always pass `{ importMeta: import.meta }` to the `meow` constructor when initializing your CLI application.Remove the `hardRejection` option from your `meow` configuration. No functional changes are expected if your Node.js version is 16 or newer.
Refactor your application to use ES Modules (`import meow from 'meow';`) and ensure your `package.json` has `"type": "module"`. If using TypeScript, set `"module": "node16"` or `"nodenext"` and `"moduleResolution": "node16"` or `"nodenext"` in `tsconfig.json`.
Add `{ importMeta: import.meta }` to the `meow` constructor. This property is crucial for `meow` to correctly resolve paths to your `package.json` for displaying help and version information.Upgrade your Node.js environment to version 20 or higher. You can use tools like `nvm install 20` or `volta install node@20`.
Replace the `alias` property with `shortFlag` in your flag definitions (e.g., `shortFlag: 'r'` instead of `alias: 'r'`). If you need multiple aliases, use the new `aliases` option.
Ensure that the necessary input arguments are always provided to the CLI. If the input is not strictly mandatory in all scenarios, consider setting `input.isRequired: false` or making it a function that dynamically determines requirement.
No dependency data recorded yet.