remove timeout on stdin
This commit is contained in:
父節點
99a8cfe6fb
當前提交
71dfe2e7a3
8
cli.js
8
cli.js
@ -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;
|
||||
});
|
||||
|
||||
|
載入中…
x
新增問題並參考
Block a user