
Product
Introducing GitHub Actions Scanning Support
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
@keg-hub/spawn-cmd
Advanced tools
// With Yarn
yarn add @keg-hub/spawn-cmd
// With NPM
npm install @keg-hub/spawn-cmd
// * Require code
const { spawnCmd } = require('@keg-hub/spawn-cmd')
// Spawns a new terminal session and runs `ls -la` inside of it
await spawnCmd('ls -la')
// Pass in a config object as the second argument
// See more information about the config in the config section
const config = { args: [ '-la' ] cwd: __dirname }
await spawnCmd('ls', config)
// Pass in a directory to run the command from as the third argument
const config = { args: [ '-la' ] cwd: __dirname }
await spawnCmd('ls', config, path.join(__dirname, '../'))
defaultSettings = {
gid: process.getgid(),
uid: process.getuid(),
env: process.env,
cwd: rootDir, // Project root directory, NOT spawn-cmd directory
stdio: 'inherit',
}
asyncCmd
child_process.exec const { asyncCmd } = require('@keg-hub/spawn-cmd')
;(()=>{
const { error, data, exitCode } = await asyncCmd('echo test')
// String output of stderr
console.log(error)
// String output of stdout
console.log(data)
// Numbered exit code from the command
// 0 === success, anything else is exit from error
console.log(exitCode)
})()
FAQs
Cross platform child_process execution in Node
The npm package @keg-hub/spawn-cmd receives a total of 1,393 weekly downloads. As such, @keg-hub/spawn-cmd popularity was classified as popular.
We found that @keg-hub/spawn-cmd demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers 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
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.

Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.

Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.