Sha256: 427259e924859d28f8c4c400ae56419879f066c915cbcd7227ef7647ac4b9b2c
Contents?: true
Size: 520 Bytes
Versions: 33
Compression:
Stored size: 520 Bytes
Contents
var Transform = require('stream').Transform function Stringifier () { if (!(this instanceof Stringifier)) { throw new TypeError('Cannot call a class as a function') } Transform.call(this, { objectMode: true }) } Stringifier.prototype = Object.create(Transform.prototype) Stringifier.prototype._transform = function (data, _, cb) { var value try { value = JSON.stringify(data) } catch (err) { err.source = data return cb(err) } cb(null, value + '\n') } module.exports = Stringifier
Version data entries
33 entries across 33 versions & 1 rubygems