Reversible
Reverse Stream data chunks!
install:
$ npm install reversible
include in your project:
var reverse =
Simple buffer example:
var Readable = Readable var values = 'one' 'two' 'three' 'four' 'five' readIndex = 0 var readable = readable { var index = readIndex++ value = valuesindex if value !== undefined value += '\n' readable } readable
Example reading file splitting on new line:
var fs = splitStream = new PassThrough splitStream { Stringchunk } fs
You can also pipe objects by passing in the objectMode flag:
var stream = readable = stringify = index = 0 data = no: 'one' no: 'two' no: 'three' no: 'four' no: 'five' readable { this } readable_readableStateobjectMode = true stringifystart = true stringify_writableStateobjectMode = true stringify { var data = JSON if stringifystart stringify stringifystart = false else data = ',' + data stringify } stringify { stringify } readable