readline uses .on('close'), not .on('end')

14 views
Skip to first unread message

Steve Litt

unread,
Aug 28, 2015, 10:42:43 PM8/28/15
to nodejs
This might prevent someone else from taking a lot of time to discover it.
I learned it the hard way.

When you're using var rl = readline.createInterface(instream, outstream); ,
you use rl.on('close'), not the rl.on('end') you use on http operations.

I use readline to read a file a line at a time and replace any encountered tokens.

SteveT
Reply all
Reply to author
Forward
0 new messages