
Security News
Node.js TSC Votes to Stop Distributing Corepack
Corepack will be phased out from future Node.js releases following a TSC vote.
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 12 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
Corepack will be phased out from future Node.js releases following a TSC vote.
Research
Security News
Research uncovers Black Basta's plans to exploit package registries for ransomware delivery alongside evidence of similar attacks already targeting open source ecosystems.
Security News
Oxlint's beta release introduces 500+ built-in linting rules while delivering twice the speed of previous versions, with future support planned for custom plugins and improved IDE integration.