getopts
npmv2.3.0TypeScriptParse CLI arguments.
Overview
getopts is an npm package that parse CLI arguments. It is very popular, with about 4M downloads per week and 1 known dependents in the graph. The latest version is 2.3.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need parse CLI arguments and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (4M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
- Lean dependency tree (2 direct dependencies).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Relationship graph
Dependencies (left) and dependents (right) of getopts.
Dependencies
Dev (2)
Used by
Popular packages that depend on getopts.
Alternatives to getopts
the complete solution for node.js command-line programs
option parsing and help generation
A querystring parser that supports nesting and arrays, with a depth limit
TypeScript Execute (tsx): Node.js enhanced with esbuild to run TypeScript & ESM files
The React Framework
Functions for dealing with a PostgreSQL connection string
Parse, validate, manipulate, and display dates
yargs the modern, pirate-themed, successor to optimist.
Utility to parse a string bytes to bytes and vice-versa
Let a globally installed package use a locally installed version of itself if available
Parses set-cookie headers into objects
Get the command from a shebang
Frequently installed together
The semantic version parser used by npm.
Lightweight debugging utility for Node.js and the browser
the complete solution for node.js command-line programs
Resolve the path of a module like `require.resolve()` but from a given path
A tiny (183B to 210B) and fast utility to ascend parent directories
Lodash modular utilities.
An AST-based pattern checker for JavaScript.
Prettier is an opinionated code formatter
🌈Easily set your terminal text color & styles.
Determine the `package.json#type` which applies to a location
Functions for dealing with a PostgreSQL connection string
PostgreSQL client - pure javascript & libpq with the same API
Version history
| Version | Published | License |
|---|---|---|
| 2.3.0latest | 5 years ago | MIT |
| 2.2.5 | 7 years ago | MIT |
| 2.2.4 | 7 years ago | MIT |
| 2.2.3 | 7 years ago | MIT |
| 2.2.2 | 7 years ago | MIT |
| 2.2.1 | 8 years ago | MIT |
| 2.2.0 | 8 years ago | MIT |
| 2.1.2 | 8 years ago | MIT |
| 2.1.1 | 8 years ago | MIT |
| 2.1.0 | 8 years ago | MIT |
| 2.0.6 | 8 years ago | MIT |
| 2.0.5 | 8 years ago | MIT |
| 2.0.4 | 8 years ago | MIT |
| 2.0.3 | 8 years ago | MIT |
| 2.0.2 | 8 years ago | MIT |
| 2.0.1 | 8 years ago | MIT |
| 2.0.0 | 8 years ago | MIT |
| 1.0.2 | 8 years ago | MIT |
| 1.0.1 | 8 years ago | MIT |
| 1.0.0 | 8 years ago | MIT |
Maintainers
Frequently asked questions
How do I install getopts?
Run `npm install getopts` to add getopts to your npm project.
What license is getopts released under?
getopts is distributed under the MIT license.
How popular is getopts?
getopts has approximately 4,013,727 downloads per week and 1 known dependent packages.