Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

args-parser

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

args-parser - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

2

dist/parse.min.js

@@ -6,2 +6,2 @@ /*

*/
"use strict";function Parse(a){a=a.slice(2);var b={};return a.forEach(function(a,c){a=a.split("=");var d=a[0];"--"==d.slice(0,2)&&(d=d.slice(2)),"-"==d.slice(0,1)&&(d=d.slice(1));var e=2===a.length?a[1]:void 0;b[d]=e}),b}module.exports=Parse;
"use strict";function Parse(a){a=a.slice(2);var b={};return a.forEach(function(a,c){a=a.split("=");var d=a[0];"--"==d.slice(0,2)&&(d=d.slice(2)),"-"==d.slice(0,1)&&(d=d.slice(1));var e=2===a.length?a[1]:true;b[d]=e}),b}module.exports=Parse;
{
"name": "args-parser",
"version": "1.0.0",
"version": "1.0.1",
"description": "Straight-forward node.js arguments parser",

@@ -5,0 +5,0 @@ "main": "parse.js",

@@ -34,4 +34,4 @@ "use strict";

// Associate defined value or initialize it to "undefined" state
var argValue = (arg.length === 2) ? arg[1] : undefined;
// Associate defined value or initialize it to "true" state
var argValue = (arg.length === 2) ? arg[1] : true;

@@ -38,0 +38,0 @@ // Finally add the argument to the args set

@@ -34,7 +34,15 @@ # args-parser

{
careful: undefined,
dangerous: undefined,
tomatoes: 3,
tonight: undefined
"careful": true,
"dangerous": true,
"tomatoes": 3,
"tonight": true
}
```
So then you can easily check what you need:
```javascript
if (args.careful) {
// Do something
}
```
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