
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
promisify-cli
Advanced tools
Promsifiy-cli is just a cli parser following *nix common line arguments conventions, used by promising way.
promsifiy-cli is just a cli parser following *nix common line arguments conventions, used by promising way. but it is different.
CLI is just a piece of program, we can just think of it as a function, function requires input and give out results. that's all.
promisify-cli is trying to make cli more intuitive, using it just like invoking a function.
promsifiy-cli converts all command line flags switches and arguments into function params and options.
You can use it building efficient cli tools.
CLI Files
/*
In package.json adding a new Field `cli`
*/
//WARNING: '-h', '--help', '-v', '--version' are preserved. They are used to print out Usage or Version information.
{
......
cli:[{
"flag": "-p"
//or "flag": "-p --port" specify multiple flags, short/long flags
//or "flag": "-p, --port <port>" indicats *required* param
//or "flag": "-p --port [port]" indicats [optional] param
//"name": "alias name of port" explicitly to customize its name
//"required" : true / false explicitly to specify whether it's optional or must required
//"value": "defaultValue" explicitly assign a default value
//"desc": "description message" descriptin message
},
{
"flag": "--host"
}]
......
}
/*
./index.js
*/
var cli = require('../promisify-cli');
//eg cli: startserver -p 80 --host 192.168.28.3 ./www
cli()
.then(function (cli) {
console.log('data->', cli.params, cli.options);
/* params
[
'./www'
]
*/
/* options
{
p: '80',
host: '192.168.28.3'
}
*/
}
})
.catch(function (e) {
console.error('catch->', e.message);
})
WARNING:
-h,--help,-v,--versionare preserved. They are used to print out Help,Usage,Version information.
cli([flags[,options]]) function get cli object
[flags]
eg: ['-p',80,'--host','localhost'] to test you funcationality. default get from `process.argv` automatically. you don't need to specify it probably.
[options]
* enableUnkownOptions if it allows unknown options from command line.
cli.params [] parsed arguments from command line
cli.options {} parsed flags from command line
cli.help function print out all usage and help information and exit.
specially thanks to commander
FAQs
Promsifiy-cli is just a cli parser following *nix common line arguments conventions, used by promising way.
We found that promisify-cli demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.