const { spawn } = require('child_process')
const child = spawn('wc')
process.stdin.pipe(child.stdin)
child.stdout.on('data', (data) => {
console.log(`child stdout:\n ${data}`)
})
The child.stdout.on('data'... will execute when pressing ctrl+d under parent process ,
Why not ctrl+c ?
via stackoverYC
No comments:
Post a Comment