README.md

Getopts

Getopts is a Node.js CLI options parser. It's designed according to the Utility Conventions so that your programs behave like typical UNIX utilities effortlessly — without sacrificing developer experience.

Need for speed? Getopts is optimized for runtime performance and runs 10 to 20 times faster than alternatives according to our benchmarks.

API

getopts(argv, options)

argv

Arguments that begin with one or two dashes are called options or flags. Options may have one or more aliases. The underscore key stores operands. Operands include non-options, the single dash - and all the arguments after --.

options.alias

An object of option aliases. An alias can be a string or an array of strings.