
Product
A New Design for GitHub PR Comments
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.
simple-cli-parser
Advanced tools
A simple parser for a spawning child_process, with promises.
npm install simple-cli-parser --save
To see the result of ls -la.
'use strict';
const cli = require('simple-cli-parser');
let ls = new cli([ 'ls', '-la', __dirname ])
.then(res => { console.log('Success!', res); })
.catch(err => { console.log('Failed!'); });
To stream the result of a curl download (to check current percentage).
'use strict';
const cli = require('simple-cli-parser'),
currentPercentage = data => { // Optional function for checking status
let percent = parseFloat(data, 10);
if (!isNaN(percent) && percent > 0){ console.log(percent + '%'); }
};
let download = new cli([ 'curl', '-O', 'http://speedtest.ftp.otenet.gr/files/test10Mb.db', '-#' ], currentPercentage)
.then(res => { console.log('Success!', res); })
.catch(err => { console.log('Failed!'); });
To pass options (https://nodejs.org/api/child_process.html)
'use strict';
const cli = require('simple-cli-parser');
let ls = new cli([ 'git', 'branch', '-a' ], null, { cwd: '/repos/app' })
.then(res => { console.log('Success!', res); })
.catch(err => { console.log('Failed!'); });
FAQs
child_process via spawn parser, very simple.
The npm package simple-cli-parser receives a total of 7 weekly downloads. As such, simple-cli-parser popularity was classified as not popular.
We found that simple-cli-parser 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.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.
Product
Our redesigned Repositories page adds alert severity, filtering, and tabs for faster triage and clearer insights across all your projects.
Security News
Slopsquatting is a new supply chain threat where AI-assisted code generators recommend hallucinated packages that attackers register and weaponize.