split-transform-stream
A combination of through2 and split with a straightforward interface.
Last updated 9 years ago by alessioalex .
MIT · Repository · Bugs · 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 1
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (3)
Dependents (1)

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