Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

Close child's stdin

View child.js
1 2 3 4 5 6 7 8 9 10 11 12
console.log('Hello');
var stdin = process.openStdin();
stdin.on('data', function (d) {
console.log('Oh, I can exit now');
stdin.pause();
});
process.on('exit', function () {
console.log('Oh, I am exitting now');
});
setTimeout(function () {
console.log('real exit');
}, 1000);
View child.js
1 2 3 4 5 6
var spawn = require('child_process').spawn;
 
var c = spawn('node', ['child.js']);
c.stdin.destroy();
c.stdout.pipe(process.stdout);
c.stderr.pipe(process.stderr);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.