split-transform-stream
A combination of through2 and split with a straightforward interface.
Last updated 11 years ago by alessioalex .
MIT · Original npm · Tarball · package.json
$ npm install split-transform-stream 
SYNC missed versions from official npm registry.

split-transform-stream

A combination of through2 and split with a straightforward interface.

build status

Usage

splitStream(inputStream, write, [end], [splitText])

returns a stream

Example

var readStream = require('fs').createReadStream(__filename, 'utf8');
var splitStream = require('./index');
var write = function(line, encoding, next) {
  this.push(line.split(' ').reverse().join(' '));

  next();
};

// emitting lines in reverse
splitStream(readStream, write).on('data', function(data) {
  console.log(data);
}).on('error', function(err) {
  if (err) { throw err; }
}).on('end', function() {
  console.log('done');
});

License

MIT

Current Tags

  • 1.0.0                                ...           latest (9 years ago)

3 Versions

  • 1.0.0                                ...           9 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 2
Today 1
This Week 1
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (1)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE