mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-22 05:09:05 +00:00
Send to zulip
This commit is contained in:
25
aws/lambda-nodejs18.x/UpdateZulipStreams/node_modules/browser-stdout/index.js
generated
vendored
Normal file
25
aws/lambda-nodejs18.x/UpdateZulipStreams/node_modules/browser-stdout/index.js
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user