How to use the Duplex function from readable-stream
Find comprehensive JavaScript readable-stream.Duplex code examples handpicked from public code repositorys.
152 153 154 155 156 157 158 159 160 161
- __'finish'__: - __'pipe'__: - __'unpipe'__: - __'error'__: ### stream.Duplex - __'readable'__: - __'data'__: - __'end'__: - __'close'__:
46
839
48
GitHub: maxogden/multiplex
10 11 12 13 14 15 16 17 18 19
var pool = new Buffer(10 * 1024) var used = 0 var Channel = function (name, plex, opts) { if (!opts) opts = {} stream.Duplex.call(this) this.name = name this.channel = 0 this.initiator = false
29
141
10
+ 3 other calls in file
32 33 34 35 36 37 38 39 40 41
options = options ? Object.assign({}, options, options.qs) : {} const multipart = new Multipart() const retStream = new Duplex({ objectMode: true }) retStream._read = (n) => {} retStream._write = (file, enc, _next) => {
16
27
4
+ 9 other calls in file
29 30 31 32 33 34 35 36 37 38
return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs) } var Duplexify = function(writable, readable, opts) { if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts) stream.Duplex.call(this, opts) this._writable = null this._readable = null this._readable2 = null
7
19
16
+ 13 other calls in file
8 9 10 11 12 13 14 15 16 17
module.exports = DiffStream function DiffStream (dag, opts) { if (!opts) opts = {} if (!(this instanceof DiffStream)) return new DiffStream(dag, opts) stream.Duplex.call(this, {objectMode: true, highWaterMark: 16}) var self = this this.destroyed = false
3
32
8
GitHub: Zuberkhan56/livestream
5383 5384 5385 5386 5387 5388 5389 5390 5391 5392
opts = Object.assign({ allowHalfOpen: false }, opts) stream.Duplex.call(self, opts) self.channelName = opts.initiator ? opts.channelName || randombytes(20).toString('hex') : null
0
0
0
+ 2 other calls in file
readable-stream.call is the most popular function in readable-stream (1227 examples)