You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The integer and choice parameter types would need to be implemented by layering additional parameter validation on top of underlying string parameter types, but that's pretty much how it works anyway.
The concept of actions is not built in, but a sample of how that can be accomplished:
The largest value proposition here with this model of implementing actions is that we can make the parser be async and defer-load actions so that we only pay for the code when either asking for --help or if that is the action being invoked, which is a significant gap in the current argparse implementation.
Summary
Node's built-in
util.parseArgs
functionality appears to be sufficiently feature-complete that we should be able to remove our dependency onargparse
in favor of it:https://nodejs.org/docs/latest-v22.x/api/util.html#utilparseargsconfig
Details
The
integer
andchoice
parameter types would need to be implemented by layering additional parameter validation on top of underlyingstring
parameter types, but that's pretty much how it works anyway.The concept of actions is not built in, but a sample of how that can be accomplished:
The text was updated successfully, but these errors were encountered: