line-simple-stream

A simple-stream for lines of a string stream

npm install line-simple-stream
8 downloads in the last month

line-simple-stream

Build Status

NPM

Transform a string simple-stream into a line stream.

var createLineStream = require('line-simple-stream')
var streamUtils = require('simple-stream')

var fsStream = fs.createReadStream('your_file.txt', {encoding: 'utf8'})

// wrap the file stream in a simple-stream
var fileSimpleStream = streamUtils.fromReadableStream(fileStream)

// transform the file stream into a line stream
var lineIterator = createLineIterator(fileIterator)

// print the file
streamUtils.forEach(lineIterator, console.log)(function() {
  console.log('done')
})

Contributors

npm loves you