
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
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 11 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.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.