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

argh

Package Overview
Dependencies
Maintainers
3
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

argh - npm Package Compare versions

Comparing version 0.1.4 to 1.0.0

5

CHANGELOG.md

@@ -0,1 +1,6 @@

# CHANGELOG
### 1.0.0
- [breaking] Duplicate flags are now consolidated into an array of values.
### 0.1.3

@@ -2,0 +7,0 @@ - Allow every printable ASCII char to be used within arguments. #9

10

index.js

@@ -112,9 +112,15 @@ 'use strict';

var property = properties.shift();
var current = position[property];
if (properties.length) {
if ('object' !== typeof position[property] && !Array.isArray(position[property])) {
if ('object' !== typeof current && !Array.isArray(current)) {
position[property] = Object.create(null);
}
} else {
position[property] = value;
if (property in position) {
if (Array.isArray(current)) current.push(value);
else position[property] = [current, value];
} else {
position[property] = value;
}
}

@@ -121,0 +127,0 @@

14

package.json
{
"name": "argh",
"version": "0.1.4",
"version": "1.0.0",
"description": "light weight option/argv parser for node, it only parses options, nothing more then that.",

@@ -17,3 +17,3 @@ "main": "index.js",

"type": "git",
"url": "git@github.com:observing/argh.git"
"url": "git@github.com:3rd-Eden/argh.git"
},

@@ -31,10 +31,10 @@ "keywords": [

],
"author": "Arnout Kazemier <opensource@observe.it>",
"author": "Arnout Kazemier",
"license": "MIT",
"devDependencies": {
"assume": "1.2.x",
"istanbul": "0.3.x",
"mocha": "2.2.x",
"pre-commit": "1.0.x"
"assume": "~2.2.0",
"istanbul": "~0.4.5",
"mocha": "~6.1.4",
"pre-commit": "~1.2.0"
}
}
# argh!
[![Build Status](https://travis-ci.org/observing/argh.png?branch=master)](https://travis-ci.org/observing/argh)
`argh` is an extremely light weight options or `process.argv` parser for node.js.

@@ -132,2 +130,12 @@ It only includes the bare minimal to parse options. It's not a full blown cli

## License MIT
Parsing duplicate flags:
```
$ node parse.js --item foo --item bar --item baz
{ item: [ 'foo', 'bar', 'baz' ] }
```
## License
[MIT](LICENSE)
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