split stream into line sized chunks
The lino Node.js package splits streams into line sized chunks.
var lino = require'lino'var lines = linolineswrite'Chunks are buffered until the 'lineswrite'the first newline character 'lineswrite'is encountered.\n'lineswrite'No characters are removed.\n'lineswrite'At the end, the rest 'linesend'gets flushed.'linespipeprocessstdout
lino exports a single function that returns a Transform stream. This duplex stream splits its inputs at line breaks to output line sized chunks.
With npm do:
$ npm install lino