UNPKG

streamlined

Version:

Collection of helper streams to deal with mapping/transforming object streams

13 lines (11 loc) 284 B
// helper stream to JSONify objects var stream = require('stream'); module.exports = stringify; function stringify() { var s = stream.Transform({ objectMode: true }); s._transform = function (data, enc, cb) { s.push(JSON.stringify(data) + '\n'); cb(); }; return s; }