Skip to content

parseArgs Type Definition #47487

Open
Open
@marcobarrios-fi

Description

@marcobarrios-fi

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.

options: {
  verbose: {
    short: "v",
    boolean: true
  }
}

Furthermore, I would prefer the options to be an array of objects, as this would make it easier work with them.

options: [
  {
    long: "output",
    short: "o",
    required: true
  },
  {
    long: "verbose",
    short: "v",
    boolean: true
  }
}

Thank you for including the parseArgs feature in Node!

Metadata

Metadata

Assignees

No one assigned

    Labels

    utilIssues and PRs related to the built-in util module.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions