From 71dfe2e7a3bd56eda86c991d00d06c72f652c4ab Mon Sep 17 00:00:00 2001 From: Eugene Sharygin Date: Mon, 8 Jun 2015 14:35:39 +0300 Subject: [PATCH] remove timeout on stdin --- cli.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/cli.js b/cli.js index 0084ee8..058d13c 100644 --- a/cli.js +++ b/cli.js @@ -59,23 +59,15 @@ 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; }); - + stdin.on('end', function () { cb(null, text); });