Skip to content

argument parsing #19

Closed
Closed
@boneskull

Description

@boneskull

Node.js can do better than process.argv.slice(2).

I'd like to discuss what the scope of something like this should be. Just a couple notes from my head:

  • People have opinions and different needs around how arguments should be parsed, so we're not likely to please everybody with an implementation, which is fine; those who want something different don't need to use it.
  • My original intuition here was that automated help output would be overreaching. But, seeing as how help output is literally in every single command-line tool (failing that, a man page), we should strongly consider it.
  • The API should be familiar to Node.js users.
  • As this would likely require a new module name, I'm unsure what to call it to avoid potential collisions (assuming there's not going to be a namespace to put it in)
  • It could be a "blessed" Node.js org project, and eventually make its way into core.

Prior art:

(team: feel free to add more links to examples)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions