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.0.4 to 2.0.5

2

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

@@ -6,0 +6,0 @@ "license": "MIT",

@@ -22,3 +22,3 @@ # Getopts

<pre>
$ <a href="./example/demo">example/demo</a> --super=sonic -xU9000 -- game over
$ <a href="./example/demo">example/demo</a> --super=sonic -xu9000 -- game over
</pre>

@@ -32,3 +32,3 @@

s: "super",
U: "ultra"
u: "ultra"
},

@@ -43,3 +43,3 @@ default: {

```jsx
```js
{

@@ -49,3 +49,3 @@ _: ["game", "over"],

s: "sonic",
U: "9000",
u: "9000",
super: "sonic",

@@ -72,5 +72,5 @@ ultra: "9000",

```js
getopts(["-U"], {
getopts(["-u"], {
alias: {
U: ["u", "ultra"]
u: ["U", "ultra"]
}

@@ -82,8 +82,8 @@ }) //=> { _:[], u:true, U:true, ultra:true }

An array of options that should be parsed as booleans. In the example, by indicating that `U` is a boolean option, the number `1` is parsed as an operand and not as a value.
An array of options that should be parsed as booleans. In the example, by indicating that `u` is a boolean option, the number `1` is parsed as an operand and not as a value.
```js
getopts(["-U", 1], {
boolean: ["U"]
}) //=> { _:[1], U:true }
getopts(["-u", 1], {
boolean: ["u"]
}) //=> { _:[1], u:true }
```

@@ -96,7 +96,7 @@

```js
getopts(["-U"], {
getopts(["-u"], {
default: {
turbo: true
}
}) //=> { _:[], U:true, turbo:true }
}) //=> { _:[], u:true, turbo:true }
```

@@ -103,0 +103,0 @@

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