docs: add util.parseArgs replacements for CLI argument parsers#274
docs: add util.parseArgs replacements for CLI argument parsers#274bjnewman wants to merge 1 commit intoes-tooling:mainfrom
Conversation
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+).
|
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. |
|
sorry its taken me a while to get to this i think we need some 2nd opinions here as this diverges from the usual structure we have we follow one of two paths so far:
in this case, it is listing the things being replaced along with their migrations. which is different to all other docs @Fuzzyma thoughts? |
|
hm, so would you rather have x documents that all have one migration "x to fetch" and then in the fetch document link to all migrations? I think that would be cumbersome. Is there a reason we usually dont have migrations in the "fetch-like" documents? |
|
Thanks for the great work on this project and for taking the time to I was loosely modeling off of Happy to restructure to better fit the project — just let me know what |
|
i more meant that the way im finding it difficult to find the right words to explain this 😂 the fetch document explains fetch and alternative packages. this document explains packages being replaced. i.e. the focus/context in the fetch doc is the alternatives, but the focus in this one is the replaced modules. EDIT: like the title of the page is |
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
minimistmriargmeowyargs-parseryargscommandersadeChanges
docs/modules/parseargs.mdwith migration examples for each packagemanifests/preferred.jsonNotes
??) for defaults instead ofparseArgs'sdefaultoption to ensure compatibility with all Node 18.3+ versions