Security News
Opengrep Emerges as Open Source Alternative Amid Semgrep Licensing Controversy
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
用于方便的解析用户输入的命令行参数,
npm install --save easy-arg
// 引入并创建一个实例
const EasyArg = require('ease-arg');
const easyArg = new EasyArg('hello');
add
添加一个命令
// 添加init命令,用户输入在init后的参数会以数组的形式传入
// 只有add过的字符串,我们才认为是命令,否则一律认为是参数
easyArg.add('init', (input) => {
console.log('input', input);
});
start
开始解析
// 参数为用户输入的所有命令以及参数组成的对象
easyArg.start((inputCommands) => {
console.log(inputCommands);
});
支持事件的方式触发
// 每当匹配到一个命令的时候,就会触发,接受命令的值以及命令的参数
easyArg.on('command', ({command, args}) => {
if (command === '-b') {
console.log(args);
}
});
FAQs
The npm package easy-arg receives a total of 0 weekly downloads. As such, easy-arg popularity was classified as not popular.
We found that easy-arg 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
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.