Skip to content

util: add parseArgs module#42675

Merged
nodejs-github-bot merged 2 commits intonodejs:masterfrom
bcoe:parse-args
May 24, 2022
Merged

util: add parseArgs module#42675
nodejs-github-bot merged 2 commits intonodejs:masterfrom
bcoe:parse-args

Conversation

@bcoe
Copy link
Copy Markdown
Contributor

@bcoe bcoe commented Apr 9, 2022

Adds util.parseArgs helper for higher level command-line argument parsing.


Background

There has been an ongoing effort in pkgjs/parseargs to define a command-line argument parsing API for Node.js core.

The effort has taken several years to get to this point, with many amazing contributors across a variety of companies and projects: IBM, Microsoft, Google, Shopify, npm, nvm, commander, yargs, just to name a few.

Where parseArgs is at

@shadowspawn, who's been most recently pushing a lot of the work on parseArgs forward, indicates in pkgjs/parseargs/issues/87 that "we're close to having a decent MVP."

I agree, and thought it would be worth having a candidate PR open on Node.js to get additional feedback.

This is a controversial topic, be kind

There's a lot of nuance and opinion, as to what constitutes a "decent MVP" for a command-line argument parser. Please be respectful of opinions you might not agree with 😊

Before leaving feedback on this thread, I suggest reading past issues on parseArgs. Perhaps there's already been a discussion that touches on your feedback (or there's an ongoing discussion).

Similarly, if themes of discussion jump out in this PR, let's move them to an issue in parseArgs (this should help keep this PR less confusing).

ToDo

CC: @ljharb, @bakkot, @iansu, @darcyclarke, @ruyadorno, @shadowspawn, @nodejs/tooling, @Trott (who I believe asked after this), @aaronccasanova.

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

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. commit-queue-squash Add this label to instruct the Commit Queue to squash all the PR commits into the first one. lib / src Issues and PRs related to general changes in the lib or src directory. needs-ci PRs that need a full CI run. notable-change PRs with changes that should be highlighted in changelogs. semver-minor PRs that contain new features and should be released in the next minor version. util Issues and PRs related to the built-in util module.

Projects

None yet

Development

Successfully merging this pull request may close these issues.