Repository navigation
parseArgs Type Definition #47487
Description
Activity
cc @bcoe @RaisinTen @aduh95 (pinging Ben who added it and some people who reviewed that since I'm not sure what team to ping)
- addedutilIssues and PRs related to the built-in util module.Issues and PRs related to the built-in util module.
on Apr 9, 2023 Instead of having a type property with either a "string" or "boolean" value, I believe it would be more intuitive to have a boolean property with either true or false value, with the default value being false.
This was deliberate in case there was expansion of types in the future or by third parties. The original design had a
withValuearray and the current naming was first discussed in refactor: pkgjs/parseargs#63 (comment)Reacted by Benjamin GruenbaumFurthermore, I would prefer the options to be an array of objects, as this would make it easier work with them.
I think implicitly we were thinking of a key/value lookup of the options properties, but an array could work too. I think the difference is probably not compelling enough to change, also with
parseArgsmoving to stable in #46640Proposal for refactor leading to current configuration:
pkgjs/parseargs#45Edit: Also I don't know if it would be possible to do the strong typing of the parse results in TypeScript if the options configuration was a plain array.
Reacted by Benjamin Gruenbaum(Two good questions @marcobarriosfi )
(The TS bit is possible to type though I actually personally like the current API better)
Reacted by John GeeThis issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.- addedstaleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.Issues and PRs marked stale due to inactivity and scheduled for automatic closure.
on Jun 5, 2026 This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 240 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.
Instead of having a
typeproperty with either a"string"or"boolean"value, I believe it would be more intuitive to have abooleanproperty with eithertrueorfalsevalue, with the default value being false.Furthermore, I would prefer the options to be an array of objects, as this would make it easier work with them.
Thank you for including the parseArgs feature in Node!