
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
@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
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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.