Gathering detailed insights and metrics for exec-sh
Gathering detailed insights and metrics for exec-sh
Gathering detailed insights and metrics for exec-sh
Gathering detailed insights and metrics for exec-sh
@doctorwork/components
``` find . -name '*.scss' -exec sh -c 'mv "$0" "${0%.scss}.styl"' {} \;
@actions/exec
Actions exec lib
exec-limiter
Limit the shell execution commands to <x> calls same time.
@percy/cli-exec
Percy CLI commands for running a local snapshot server using [`@percy/core`](./packages/core).
npm install exec-sh
98.7
Supply Chain
99
Quality
76
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
63 Stars
75 Commits
10 Forks
3 Watching
1 Branches
5 Contributors
Updated on 14 May 2024
JavaScript (96.09%)
TypeScript (3.91%)
Cumulative downloads
Total Downloads
Last day
-10.3%
1,430,105
Compared to previous day
Last week
2.7%
9,260,817
Compared to previous week
Last month
59.9%
32,444,221
Compared to previous month
Last year
-31.5%
285,822,471
Compared to previous year
9
Execute shell command forwarding all stdio streams.
exec-sh is a wrapper for child_process.spawn
with some improvements:
cmd /C COMMAND
sh -c COMMAND
execSh("bash")
execsh("echo -n Say: && read i && echo Said:$i")
execSh("pwd", console.log)
1// JavaScript 2 3execSh("echo hello exec-sh && bash", { cwd: "/home" }, function(err){ 4 if (err) { 5 console.log("Exit code: ", err.code); 6 } 7});
1# Terminal output: interactive bash session 2 3hello exec-sh 4bash-3.2$ pwd 5/home 6bash-3.2$ exit 99 7exit 8Exit code: 99
1const execSh = require("../"); 2 3// run interactive bash shell 4execSh("echo lorem && bash", { cwd: "/home" }, (err) => { 5 if (err) { 6 console.log("Exit code: ", err.code); 7 return; 8 } 9 10 // collect streams output 11 const child = execSh(["bash -c id", "echo lorem >&2"], true, 12 (err, stdout, stderr) => { 13 console.log("error: ", err); 14 console.log("stdout: ", stdout); 15 console.log("stderr: ", stderr); 16 }); 17});
1const execShPromise = require("exec-sh").promise; 2 3// run interactive bash shell 4const run = async () => { 5 let out; 6 7 try { 8 out = await execShPromise('pwd', true); 9 } catch (e) { 10 console.log('Error: ', e); 11 console.log('Stderr: ', e.stderr); 12 console.log('Stdout: ', e.stdout); 13 14 return e; 15 } 16 17 console.log('out: ', out.stdout, out.stderr); 18} 19 20run();
execSh(command, [options], [callback])
Execute shell command forwarding all stdio.
Parameters:
command {String|Array}
- The command to run, or array of commands[options] {Object|TRUE}
- Options object passed directly to child_process.spawn
, when TRUE
then { stdio: null }
used[callback] {Function}
- callback(err, stdout, stderr)
err {Error|NULL}
- Error object. Has code
property containing last command exit code when availablestdout {String|NULL}
- aggregated stdout or NULL
if not availablestderr {String|NULL}
- aggregated stderr or NULL
if not availableReturn Values:
Returns ChildProcess object.
npm test
- run testsnpm run jsdoc
- build jsdocnpm run dev
- run tests continuouslyThe MIT License (MIT)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
Reason
3 existing vulnerabilities detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 2
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 2/29 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More