Now when the mapper function throws, its error will be emitted on the stream object as an 'error' event. This is particularly useful for parsing newline-separated json with something like:
var split = require('split');
var s = split(JSON.parse);
s.on('error', process.exit.bind(null, 1));
process.stdin.pipe(s).pipe(process.stdout);
Now when the mapper function throws, its error will be emitted on the stream object as an
'error'
event. This is particularly useful for parsing newline-separated json with something like: