Sha256: 32d86f2a10c2d250727c2990237ec0929de6e7bb3a1bb6dc56c8f4d895f947ac
Contents?: true
Size: 649 Bytes
Versions: 6
Compression:
Stored size: 649 Bytes
Contents
var WritableStream = require('stream').Writable var inherits = require('util').inherits module.exports = BrowserStdout inherits(BrowserStdout, WritableStream) function BrowserStdout(opts) { if (!(this instanceof BrowserStdout)) return new BrowserStdout(opts) opts = opts || {} WritableStream.call(this, opts) this.label = (opts.label !== undefined) ? opts.label : 'stdout' } BrowserStdout.prototype._write = function(chunks, encoding, cb) { var output = chunks.toString ? chunks.toString() : chunks if (this.label === false) { console.log(output) } else { console.log(this.label+':', output) } process.nextTick(cb) }
Version data entries
6 entries across 6 versions & 4 rubygems