How to use the call function from readable-stream

Find comprehensive JavaScript readable-stream.call code examples handpicked from public code repositorys.

7
8
9
10
11
12
13
14
15
  opts = opts || {}

  opts.objectMode = true
  opts.highWaterMark = 16

  Transform.call(this, opts)

  this._msgpack = opts.msgpack
}
fork icon79
star icon479
watch icon15

+ 11 other calls in file

4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
if(!(this instanceof SVGPathDataEncoder)) {
  return new SVGPathDataEncoder(options);
}

// Parent constructor
TransformStream.call(this, {
  objectMode: true
});

// Setting objectMode separately
fork icon501
star icon94
watch icon0

+ 2 other calls in file

238
239
240
241
242
243
244
245
246
 if (encoding === 'u8' || encoding === 'uint8') {
  encoding = 'uint8array'
 }
}

Writable.call(this, { objectMode: true })

this.encoding = encoding
this.shouldInferEncoding = shouldInferEncoding
fork icon43
star icon88
watch icon11

+ 31 other calls in file

23
24
25
26
27
28
29
30
31
function LoggerStream(logger, opts, destroyCb) {
    if (!(this instanceof LoggerStream)) {
        return new LoggerStream(logger, opts, destroyCb);
    }

    Writable.call(this, {
        objectMode: true,
        highWaterMark: opts.highWaterMark
    });
fork icon20
star icon160
watch icon0

+ 11 other calls in file

10
11
12
13
14
15
16
17
18
19

function Graft() {
  if (!(this instanceof Graft)) {
    return new Graft();
  }
  Transform.call(this, { objectMode: true, highWaterMark: 16 });

  var that = this;

  function readFirst() {
fork icon15
star icon227
watch icon18

4
5
6
7
8
9
10
11
12
13

util.inherits(Stream, PassThrough);


function Stream(main, name, silentMode) {
  PassThrough.call(this);

  this.main = main;
  this.receiver = main.receiver;
  this.id = name;
fork icon6
star icon86
watch icon3

+ 11 other calls in file

83
84
85
86
87
88
89
90
91
92
var Transform = require('stream').Transform
var StringDecoder = require('string_decoder').StringDecoder
var inherits = require('inherits')

function CipherBase (hashMode) {
  Transform.call(this)
  this.hashMode = typeof hashMode === 'string'
  if (this.hashMode) {
    this[hashMode] = this._finalOrDigest
  } else {
fork icon2
star icon1
watch icon6

+ 3 other calls in file

10
11
12
13
14
15
16
17
18
19
this._prefixes = { _: basename }
this._count = 0
this._filter = opts.filter
this._offset = opts.offset || 0
this._limit = opts.limit && opts.limit + this._offset
Transform.call(this, Object.assign(opts, { objectMode: true }))
this._sources = []
this.once('pipe', (source) => {
  source.on('error', e => this.emit('error', e))
  this._sources.push(source)
fork icon11
star icon65
watch icon10

11
12
13
14
15
16
17
18
19
20
if (!(this instanceof Feed)) return new Feed()
assert.equal(typeof opts.name, 'string', 'Feed: feed constructor must be initialized with opts.name')
assert.equal(typeof opts.url, 'string', 'Feed: feed constructor must be initialized with opts.url')
this.name = opts.name
this.url = opts.url
Readable.call(this, { objectMode: true })

this._forwarding = false

var req = request(this.url, {timeout: 10000, pool: false})
fork icon1
star icon46
watch icon11

1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
* @param {StreamHelper} helper the helper wrapping the worker
* @param {Object} options the nodejs stream options
* @param {Function} updateCb the update callback.
*/
function NodejsStreamOutputAdapter(helper, options, updateCb) {
    Readable.call(this, options);
    this._helper = helper;


    var self = this;
    helper.on("data", function (data, meta) {
fork icon8
star icon30
watch icon4

53
54
55
56
57
58
59
60
61
62
  this.emit('close')
}

var Pack = function(opts) {
  if (!(this instanceof Pack)) return new Pack(opts)
  Readable.call(this, opts)

  this._drain = noop
  this._finalized = false
  this._finalizing = false
fork icon83
star icon0
watch icon1

15
16
17
18
19
20
21
22
23
24
if (options.colored) {
    var newOptions = copyInto(render.coloredOptions);
    extendInto(newOptions, options);
    options = newOptions;
}
Transform.call(this, options);
var self = this;
self.options = options;
self.prefix = self.options.prefix || '';
self.cols = self.options.cols || 16;
fork icon4
star icon0
watch icon1

37
38
39
40
41
42
43
44
45
46
47
48
49
  this._parent.destroy(err)
}


var Extract = function (opts) {
  if (!(this instanceof Extract)) return new Extract(opts)
  Writable.call(this, opts)


  opts = opts || {}


  this._offset = 0
fork icon38
star icon0
watch icon0

9
10
11
12
13
14
15
16
17
18
19
20
21
  server: require('debug')('spdy:stream:server')
}
var Duplex = require('readable-stream').Duplex


function Stream (connection, options) {
  Duplex.call(this)


  var connectionState = connection._spdyState


  var state = {}
fork icon0
star icon0
watch icon1

44
45
46
47
48
49
50
51
52
function Class(override) {
  if (!(this instanceof Class)) return new Class(override)
  this._reading = false
  this._callback = check
  this.destroyed = false
  Readable.call(this, override || opts)

  var self = this
  var hwm = this._readableState.highWaterMark
fork icon0
star icon0
watch icon0

27
28
29
30
31
32
33
34
35
36
37
38
39


    callback = null
  }


  BufferList._init.call(this, callback)
  DuplexStream.call(this)
}


inherits(BufferListStream, DuplexStream)
Object.assign(BufferListStream.prototype, BufferList.prototype)
fork icon0
star icon0
watch icon0

10
11
12
13
14
15
16
17
18
19
20
21
22
23


function ReadStream (options, makeData) {
  if (!(this instanceof ReadStream))
    return new ReadStream(options, makeData)


  Readable.call(this, { objectMode: true, highWaterMark: options.highWaterMark })


  // purely to keep `db` around until we're done so it's not GCed if the user doesn't keep a ref


  this._waiting = false
fork icon0
star icon0
watch icon0

5
6
7
8
9
10
11
12
13
14
15
16
17


var inherits = require('inherits');
var Duplex = require('readable-stream').Duplex;


function Compressor(options) {
  Duplex.call(this, {
    writableObjectMode: true
  });


  this._encoder = null;
fork icon0
star icon0
watch icon0

32
33
34
35
36
37
38
39
40
41
42
43
util.inherits(WriteStreamAtomic, Writable)
function WriteStreamAtomic (path, options) {
  if (!(this instanceof WriteStreamAtomic)) {
    return new WriteStreamAtomic(path, options)
  }
  Writable.call(this, options)


  this.__isWin = options && options.hasOwnProperty('isWin') ? options.isWin : process.platform === 'win32'


  this.__atomicTarget = path
fork icon0
star icon0
watch icon0