autoinstallersbutbetter/install/secu/make/node_modules/cmd-promise/test/process.js

19 lines
477 B
JavaScript
Raw Permalink Normal View History

2022-05-31 19:28:17 -04:00
const cmd = require('../cmd-promise')
console.log('cmd-promise: Return child process instead of output.')
const options = { returnProcess: true }
cmd(`node -v`, options).then(childProcess => {
console.log('pid =', childProcess.pid)
childProcess.stdout.on('data', stdout => {
console.log('stdout =', stdout)
})
childProcess.stderr.on('data', stderr => {
console.log('stderr =', stderr)
})
}).catch(err => {
console.log('err =', err)
})