split/binary-split but lines contain byte offset in the source stream and gives access to last line fragment
npm install line-streamline-stream
===========
split/binary-split but lines contain byte offset in the source stream and gives access to last line fragment
- this module leaves the delimiter on the resulting buffer.
- all values are cast to buffers and emitted as buffers.
- this module is just as fast as binary-split.
``js
var linestream = require('line-stream');
var s = linestream();
s.on('data',function(line){
console.log('line of data ',line+'');
console.log('i come from ',line.start,'byte offset in the file')
})
fs.createReadStream(somefile).pipe(s);
``
api
---