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

Version Path
epuber-stylus-source-0.56.0 vendor/node_modules/browser-stdout/index.js
epuber-stylus-source-0.54.8 vendor/node_modules/browser-stdout/index.js
learn_create-0.0.22 lib/templates/javascript_lab_template/node_modules/browser-stdout/index.js
locomotivecms-4.0.0.alpha1 app/javascript/node_modules/browser-stdout/index.js
locomotivecms-3.4.0 app/javascript/node_modules/browser-stdout/index.js
stylus-source-0.54.5 vendor/node_modules/browser-stdout/index.js