tjfontaine/node-lstream — pull request #2 by philandstuff (2013-09-03 14:26:25+00:00)
Title: Don't emit spurious empty lines

data.split will always create a last line in the array, even if that
line is empty. That is, if we split `"foo\n"`, we will end up with the
array `["foo",""]`. We should not emit this empty line as it is merely the
start of the next line, and is not terminated until the next newline
marker.

It turns out that the correct thing to do is to take the last item from
the split and set this._buff to its value, whether or not the input
chunk is terminated with a newline. Thankfully, this makes the code
simpler.