Skip to content

Conversation

@bjnewman
Copy link

Summary

Adds migration documentation for replacing CLI argument parsing packages with Node.js built-in util.parseArgs (available in Node 18.3+/16.17+).

Packages covered

  • minimist
  • mri
  • arg
  • meow
  • yargs-parser
  • yargs
  • commander
  • sade

Changes

  • New docs/modules/parseargs.md with migration examples for each package
  • Added 8 entries to manifests/preferred.json

Notes

  • Examples use nullish coalescing (??) for defaults instead of parseArgs's default option to ensure compatibility with all Node 18.3+ versions
  • Includes feature comparison table and caveats about subcommands/auto-help
  • Covers advanced patterns like token-based parsing for minimist compatibility

Adds migration documentation for replacing minimist, mri, arg, meow,
yargs-parser, yargs, commander, and sade with Node.js built-in
util.parseArgs (available in Node 18.3+/16.17+).
@ljharb
Copy link

ljharb commented Jan 22, 2026

Also worth suggesting as an alternative is https://npmgraph.js.org/?q=pargs, which is built on top of util.parseArgs, has no deps, is written in ESM, and adds a number of helpful features when migrating from the listed packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants