byte-stream icon indicating copy to clipboard operation
byte-stream copied to clipboard

Invalid non-string/buffer chunk

Open fider opened this issue 7 years ago • 0 comments

Am I doing something wrong in below example?

let { Writable } = require("stream");
let fs = require("fs");
var batcher = require('byte-stream');


let input = fs.createReadStream("./test-file");

let batchedStream = batcher({time:1000, limit:100})

let output = new Writable({
    write: function writeImplementation(chunk, encoding, callback) {
        console.log(`      OUTPUT:  "${chunk.toString().replace("\n", "\\n")}"`);
    }
});


input
    .pipe(batchedStream)
    .pipe(output);

fider avatar Sep 18 '18 11:09 fider