Stop readline Writing Input to the Output
The group you are posting to is a
Usenet group . Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
From:
Volkan Yazıcı <volkan.yaz... @gmail.com>
Date: Sun, 14 Oct 2012 11:44:43 -0700 (PDT)
Local: Sun, Oct 14 2012 2:44 pm
Subject: Stop readline Writing Input to the Output
How can I make readline stop writing the read input to the output? That is, when I do
lines = []; var rl = readline.createInterface(process.stdin, process.stdout); rl.resume() rl.on("line", function (line) { lines.push(line);
});
read lines get written to the output as well. I would like to shut that
behaviour down. Any ideas?
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Alex Kocharin <a... @kocharin.ru>
Date: Sun, 14 Oct 2012 23:15:51 +0400
Local: Sun, Oct 14 2012 3:15 pm
Subject: Re: [nodejs] Stop readline Writing Input to the Output
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Volkan Yazıcı <volkan.yaz... @gmail.com>
Date: Sun, 14 Oct 2012 12:18:15 -0700 (PDT)
Local: Sun, Oct 14 2012 3:18 pm
Subject: Re: [nodejs] Stop readline Writing Input to the Output
Yeah, I can make it point to /dev/null, but isn't there a better way of doing this?
On Sunday, October 14, 2012 10:16:11 PM UTC+3, Alex Kocharin wrote:
> Replace process.stdout with a custom stream?
You must
Sign in before you can post messages.
You do not have the permission required to post.
From:
Martin Cooper <mfncoo... @gmail.com>
Date: Sun, 14 Oct 2012 14:04:53 -0700
Local: Sun, Oct 14 2012 5:04 pm
Subject: Re: [nodejs] Stop readline Writing Input to the Output
On Sun, Oct 14, 2012 at 12:18 PM, Volkan Yazıcı <volkan.yaz
... @gmail.com> wrote:
> Yeah, I can make it point to /dev/null, but isn't there a better way of
> doing this?
The output stream is required with 'readline', so you have to give it
something. Depending on your use case, you can probably do what you
want by using 'read' instead:
https://github.com/isaacs/read
--
Martin Cooper
You must
Sign in before you can post messages.
You do not have the permission required to post.