1
0

remove timeout on stdin

Este cometimento está contido em:
Eugene Sharygin 2015-06-08 14:35:39 +03:00
ascendente 99a8cfe6fb
cometimento 71dfe2e7a3

8
cli.js
Ver ficheiro

@ -59,20 +59,12 @@
function readStdin() {
var text = ''
, timeoutToken
, stdin = process.stdin
;
stdin.resume();
// how to tell piping vs waiting for user input?
timeoutToken = setTimeout(function () {
cb(new Error('no stdin data'));
stdin.pause();
}, 1000);
stdin.on('data', function (chunk) {
clearTimeout(timeoutToken);
text += chunk;
});