This repository was archived by the owner on Jul 5, 2019. It is now read-only.
This repository was archived by the owner on Jul 5, 2019. It is now read-only.
Open
Description
per the readme I should beable to pass a function to split which returns an object ( like JSON.parse
) and then get a stream of objects.
Doing this I get an error
function splitHandler(){
return {test: true};
}
var stream = fs.createReadStream(file_path)
.pipe(zlib.createGunzip())
.pipe(split(splitHandler))
.pipe(process.stdout)
net.js:614
throw new TypeError('invalid data');
^
TypeError: invalid data
at WriteStream.Socket.write (net.js:614:11)
at Stream.ondata (stream.js:51:26)
at Stream.emit (events.js:95:17)
at drain (/home/app/aquirer_shuffle/node_modules/split/node_modules/through/index.js:36:16)
at Stream.stream.queue.stream.push (/home/app/aquirer_shuffle/node_modules/split/node_modules/through/index.js:45:5)
at emit (/home/app/aquirer_shuffle/node_modules/split/index.js:33:16)
at next (/home/app/aquirer_shuffle/node_modules/split/index.js:48:7)
at Stream.<anonymous> (/home/app/aquirer_shuffle/node_modules/split/index.js:53:5)
at Stream.stream.write (/home/app/aquirer_shuffle/node_modules/split/node_modules/through/index.js:26:11)
at write (_stream_readable.js:585:24)
if I change the splitHandler
to
function splitHandler(){
return "derp";
}
and return a string it works
Metadata
Metadata
Assignees
Labels
No labels