function PubStream(client, name, dest) { if (!(this instanceof PubStream)) return new PubStream(client, name, dest); stream.Transform.call(this, {objectMode: true}); this.dest = dest; this.client = client; this.cmd = name; this.pipe(client.output); }
function MyTransform () { Transform.call(this) this._transform = function (buffer, encoding, next) { // do something with buffer this.push(buffer) next() } }
function LineSplitter(options) { if (!options) { options = {} } if (!options.transform) { options.transform = {objectMode: true} } Transform.call(this, options.transform) this._encoding = options.encoding || 'utf8' this._seperator = options.seperator || '\n' this._buffer = '' this._decoder = new StringDecoder(this._encoding) this.bytes = options.bytes || 0 }
var HeaderHostTransformer = function(opts) { if (!(this instanceof HeaderHostTransformer)) { return new HeaderHostTransformer(opts); } opts = opts || {} Transform.call(this, opts); var self = this; self.host = opts.host || 'localhost'; self.replaced = false; }
function AbortStream(highWaterMark, chunkSize) { this.highWaterMark = highWaterMark; this.chunkSize = chunkSize; stream.Transform.call(this, { highWaterMark: this.highWaterMark * 2 }); // var self = this; // setInterval(function () { // console.log(self._readableState.length) // }, 10000) }
function IbusProtocol(options) { options = options || {}; if (!(this instanceof IbusProtocol)) return new IbusProtocol(options); Transform.call(this, options); this._buffer = new Buffer(0); this._processId = 0; this._isProcessing = false; }
function SwitchBoard(sock) { if (!(this instanceof SwitchBoard)) return new SwitchBoard(sock); stream.Transform.call(this, {objectMode: true}); sock.index = getClientNumber(); crossbar[sock.index] = sock; this.sock = sock; }
function JSONLDStreamToTriples (context) { Transform.call(this, {objectMode : true}); this["@context"] = context && context["@context"] || { 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'dct' : 'http://purl.org/dc/terms/', 'rdfs' : 'http://www.w3.org/2000/01/rdf-schema#', 'xsd' : 'http://www.w3.org/2001/XMLSchema#' }; }
function Consumer(debug) { if (!(this instanceof Consumer)) return new Consumer(debug); stream.Transform.call(this, {objectMode: true}); this.subscriber = {}; this.streams = []; this.debug = debug; }
function ToGrid(debug) { stream.Transform.call(this, {objectMode: true}); this.debug = debug; }
var Deserializer = function (context) { Transform.call(this, {objectMode: true}); this._remaining = ""; this._count = 0; this["@context"] = context || { 'rdf': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'dct' : 'http://purl.org/dc/terms/', 'rdfs' : 'http://www.w3.org/2000/01/rdf-schema#', 'xsd' : 'http://www.w3.org/2001/XMLSchema#' }; }
function StreamToGrid(sock, id, sid) { stream.Transform.call(this); this.sock = sock; this.clientId = id; this.clientStreamId = sid; }
const DecoratorStream = function (decorators) { this.decorators = decorators Transform.call(this, {objectMode: true}) }
var HeaderHostTransformer = function(opts) { if (!(this instanceof HeaderHostTransformer)) { return new HeaderHostTransformer(opts); } opts = opts || {} Transform.call(this, opts); var self = this; self.host = opts.host || 'localhost'; self.replaced = false; }
function Trans(options) { stream.Transform.call(this, options); // this._key = options.key; this._value = null; // this.on('finish', function() { // Cache.store[this._key] = this._value.toString(); // }); }