Socket
Socket
Sign inDemoInstall

getopts

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

getopts - npm Package Compare versions

Comparing version 2.2.0 to 2.2.1

2

package.json
{
"name": "getopts",
"description": "Node.js CLI options parser.",
"version": "2.2.0",
"version": "2.2.1",
"main": "index.js",

@@ -6,0 +6,0 @@ "types": "getopts.d.ts",

@@ -9,3 +9,3 @@ # Getopts

Need for speed? Getopts is _10x_~_20x_ [faster](/bench) than alternatives.
Need for speed? Getopts is the [fastest](#benchmark-results) CLI parser for Node.js

@@ -25,3 +25,3 @@ ## Installation

<pre>
$ <a href="./example/demo">example/demo</a> --turbo -sw10 -- alpha beta
$ <a href="./example/demo">example/demo</a> --turbo -xw10 -- alpha beta
</pre>

@@ -46,3 +46,3 @@

w: 10,
s: true,
x: true,
t: true,

@@ -103,7 +103,7 @@ warp: 10,

```js
getopts(["----", "alpha"]) //=> { _: [], --:"alpha" }
getopts(["--warp=e=mc^2"]) //=> { _: [], warp:"e=mc^2" }
```
```js
getopts(["--warp=e=mc^2"]) //=> { _: [], warp:"e=mc^2" }
getopts(["----", "alpha"]) //=> { _: [], --:"alpha" }
```

@@ -182,3 +182,3 @@

An object of option aliases. An alias can be a string or an array of strings. Aliases let you define alternate names for an option, e.g., the short and long variations of its name, etc.
An object of option aliases. An alias can be a string or an array of strings. Aliases let you define alternate names for an option, e.g., the short and long (canonical) variations.

@@ -236,4 +236,19 @@ ```js

## Benchmark Results
All tests run on a 2.4GHz Intel Core i7 CPU with 16 GB memory.
```
npm i -C bench && node bench
```
<pre>
mri × 378,898 ops/sec
yargs × 32,993 ops/sec
<b>getopts × 1,290,267 ops/sec</b>
minimist × 289,048 ops/sec
</pre>
## License
Getopts is MIT licensed. See [LICENSE](LICENSE.md).
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc