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

cliss

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cliss - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

12

lib/cliss.js

@@ -157,10 +157,8 @@ 'use strict';

function buildOptionsFromParametersAndSpec(action, optionsSpec) {
// Build options from functions parameters and merge with options spec
return getParametersNames(action).map(parameter => {
const parameters = inspectParameters(action) || [];
const optionsFromParameters = parameters.map(({ parameter, isRestParameter }) => {
const option = { name: parameter };
const [, variadic] = parameter.match(/^\.{3}(.*)/) || [];
if (variadic) {
option.name = variadic;
option.variadic = true;
if (isRestParameter) {
option.variadic = true;
}

@@ -171,2 +169,4 @@

});
return optionsFromParameters;
}

@@ -173,0 +173,0 @@

{
"name": "cliss",
"version": "0.0.5",
"version": "0.0.6",
"description": "CLI Simple, Stupid. Automatic discovery of parameters names. Provides an easy and minimal setup by passing in only a function reference without the need of declaring all expected options names or create a help section by hand. Support to sync / async. Support to subcommands down to N levels.",

@@ -12,8 +12,8 @@ "main": "./lib/cliss.js",

"keywords": [
"cli",
"command-line interface",
"command line",
"async",
"minimal",
"simple"
"cli",
"command-line interface",
"command line",
"async",
"minimal",
"simple"
],

@@ -28,4 +28,4 @@ "repository": {

"get-stdin": "^5.0.1",
"inspect-parameters-declaration": "0.0.9",
"object-to-arguments": "0.0.8",
"inspect-parameters-declaration": "^0.1.0",
"object-to-arguments": "^0.1.0",
"pipe-functions": "^1.3.0",

@@ -32,0 +32,0 @@ "strip-ansi": "^4.0.0",

@@ -49,2 +49,16 @@ 'use strict';

}]
},
{
name: 'nested-command-promise-async',
action: async (...args) => {
return new Promise((resolve, reject) => {
setTimeout(() => resolve('promise resolved'), 1500);
});
}
}, {
name: 'nested-command-variadic-async',
action: async (...args) => {
return args.reduce((result, v) => result += v);
}
}]

@@ -51,0 +65,0 @@ };

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

nested-command-set-with-action
nested-command-promise-async
nested-command-variadic-async
`;

@@ -21,0 +23,0 @@

Sorry, the diff of this file is not supported yet

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