JSPM

split-transform-stream

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29688
  • Score
    100M100P100Q154748F
  • License MIT

A combination of through2 and split with a straightforward interface.

Package Exports

  • split-transform-stream

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (split-transform-stream) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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