minimist
Minimal command-line argument parser for Node.js. Parses process.argv into a JavaScript object with named flags, positional arguments, and boolean/string options. Zero dependencies, tiny footprint. Used by many tools as a lightweight alternative to full CLI frameworks like yargs or commander. Parses '--flag value', '-f', '--no-flag', '--key=value', and '--' separating options from positional args.
Score Breakdown
⚙ Agent Friendliness
🔒 Security
Prototype pollution vulnerability fixed in v1.2.6 — use updated version. CLI arg parsing — no network surface. Don't pass CLI args as untrusted input without validation.
⚡ Reliability
Best When
You need the simplest possible argument parsing in a Node.js script without help generation, subcommands, or validation infrastructure.
Avoid When
You're building a user-facing CLI tool that needs help text, subcommands, or validation — use yargs or commander instead.
Use Cases
- • Parse simple CLI scripts with flags and positional arguments: node script.js --input file.txt --verbose
- • Build lightweight command-line utilities without the overhead of full CLI frameworks
- • Parse webpack, gulp, or build tool arguments in simple scripts
- • Quick argument parsing for automation scripts where full yargs/commander features aren't needed
- • Parse options in makefiles, npm scripts, and simple Node.js utilities
Not For
- • Complex CLI applications with subcommands, help text generation, and validation — use yargs or commander
- • TypeScript CLI tools needing type safety and IntelliSense — use yargs or meow with TypeScript types
- • Production CLI tools requiring help/usage generation — minimist provides no help text infrastructure
Interface
Authentication
No authentication — CLI parsing utility.
Pricing
Fully free, MIT licensed.
Agent Metadata
Known Gotchas
- ⚠ No validation or required arguments — minimist parses any input without validation; must implement your own required argument checks
- ⚠ Type coercion: by default, '--port 3000' parses port as number; use string: ['port'] option to keep it as string — type inference can be surprising
- ⚠ Boolean flags: '--no-verbose' sets verbose: false; be aware of automatic boolean negation behavior
- ⚠ Prototype pollution vulnerability patched in v1.2.6+ — ensure using latest version to avoid __proto__ injection via CLI args
- ⚠ No help text generation — if your tool needs usage instructions, you must write them manually; yargs/commander auto-generate from option definitions
- ⚠ args['--'] contains everything after '--' separator — useful for passing remaining args to subprocess: node script.js --flag -- --pass-to-subprocess
Alternatives
Full Evaluation Report
Detailed scoring breakdown, competitive positioning, security analysis, and improvement recommendations for minimist.
Scores are editorial opinions as of 2026-03-06.