
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
argv-options
Advanced tools
argv-options
subjectively parses your argv
options, i.e., it makes
assumptions about how your CLI is designed to keep the API simple. It expects your argv
object to be supplied in the format of -p foo --param bar
, i.e.,
simple key-value arguments that may be aliased (using --
).
parseOptions(argv, options)
This method will return the parsed options in a key-value based object, including all found options and their respective aliases. The following arugments are mandatory:
argv
The arguments array, as space-split array of all parameters. In your
average usage case, passing process.argv.slice(2)
will do.options
The possible options, as object:{
"p": {
"optional": false,
"alias": "param"
},
"a": {
"optional": true,
"alias": "argument"
}
}
Parameters are required (optional
is false) by default. Alternatively, for
more convenient use, aliases may be specified by using the key's value:
{
"p": "param"
}
If any non-optional parameters are missing or undocumented parameters occur,
parseOptions
will throw an error.
FAQs
opinionated argv options parser
We found that argv-options demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.