-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace minimist
with parseArgs
from node:util
#31
Comments
This comment has been minimized.
This comment has been minimized.
|
What does it mean if something is stable on Node 20 but experimental on Node 16/lts and 18/lts? 😅 |
IMO yes |
I'd lean Yes as well. |
Spent a couple hours investigating. It’s not really bad. But it isn’t an improvement at all. It doesn’t lead to less code. I think one very important thing we currently have is negation: some stuff is default on, but with It’s not an improvement. It’s either a bare bones opinionated parser that throws programming exceptions if things are wrong, or it’s just a tokenizer. So perhaps in a couple years. |
To be fair I always found the behaviour of
|
Oh, wait. What? How’s that quirky? Seems normal to me. There are tons of CLIs where your expectation doesn‘t work |
|
I can’t really think of CLIs with similar behaviour that surprised me. I think the fact that this behaviour can’t be expressed with Indeed Given this is command remark -q -o . . These do the same remark -o . -q .
remark -o -q .
remark -q . -o
remark . -qo
remark . -oq
remark -oq . But these behave differently remark -q -o .
remark -qo .
remark -o . -q For similar options ESLint and Stylelint use Alternatively |
This new post seems different from your earlier statement “If |
Closing this as stalled |
Initial checklist
Problem
minimist
is an additional dependency which needs to be downloaded.Solution
Node now provides
parseArgs
as part ofnode:util
, with a similar functionality and API.It has been made available as far back as Node 16 https://nodejs.org/dist/latest-v16.x/docs/api/util.html#util_util_parseargs_config
Alternatives
continue using a user land argument parser.
The text was updated successfully, but these errors were encountered: