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

cav

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cav - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

CHANGELOG.md

14

lib/parse.js

@@ -5,2 +5,4 @@ 'use strict';

const parsedArgs = Object.keys(args).reduce((prev, current) => {
// commands
if (current === '_') {

@@ -21,5 +23,8 @@ const argument = args[current];

prev[argument[0]] = commandOptionsList;
prev.commands = Object.assign(prev.commands ||{}, {
[argument[0]]: commandOptionsList
});
}
// options
else {

@@ -32,4 +37,7 @@

if (existed) prev[current] = args[current];
return prev;
if (existed) {
prev.options = Object.assign(prev.options || {}, {
[current]: args[current]
});
}
}

@@ -36,0 +44,0 @@ return prev;

@@ -5,3 +5,3 @@ {

"author": "(http://about-hiroppy.com) abouthiroppy <git@about-hiroppy.com>",
"version": "0.0.1",
"version": "0.0.2",
"license": "MIT",

@@ -18,2 +18,6 @@ "description": "",

},
"repository": {
"url": "git+https://github.com/abouthiroppy/cav.git",
"type": "git"
},
"scripts": {

@@ -20,0 +24,0 @@ "changelog": "conventional-changelog -p angular -i CHANGELOG.md -s -r 0",

# cav
[![npm version](https://badge.fury.io/js/cav.svg)](https://badge.fury.io/js/cav)
A supporter for making your CLI.
## Install
```sh
$ npm i -S cav
```
## Examples
```js

@@ -33,3 +40,15 @@ #!/usr/bin/env node

cav.start((args) => {
// { deploy: { to: 'japan', env: 'prod' }, f: true, c: 'ok' }
console.log(JSON.stringify(args, null, 2));
// {
// "commands": {
// "deploy": {
// "to": "japan",
// "env": "prod"
// }
// },
// "options": {
// "f": true,
// "c": "ok"
// }
// }
});

@@ -36,0 +55,0 @@ ```

@@ -18,5 +18,5 @@ #!/usr/bin/env node

cav.start((args) => {
console.log(args);
console.log(JSON.stringify(args, null, 2));
});
console.log(cav.help());
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