How to use the readable-stream/transform.call function in readable-stream

To help you get started, we’ve selected a few readable-stream examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stream-utils / streaming-json-stringify / index.js View on Github external
function Stringify(options) {
  if (!(this instanceof Stringify))
    return new Stringify(options || {})
  if (options && options.replacer) {
    this.replacer = options.replacer;
  }
  if (options && options.space !== undefined) {
    this.space = options.space;
  }
  Transform.call(this, options || {})
  this._writableState.objectMode = true

  // Array Deliminator and Stringifier defaults
  var opener = options && options.opener ? options.opener : '[\n'
  var seperator = options && options.seperator ? options.seperator : '\n,\n'
  var closer = options && options.closer ? options.closer : '\n]\n'
  var stringifier = options && options.stringifier ? options.stringifier : stringify

  // Array Deliminators and Stringifier
  this.opener = new Buffer(opener, 'utf8')
  this.seperator = new Buffer(seperator, 'utf8')
  this.closer = new Buffer(closer, 'utf8')
  this.stringifier = stringifier
}
github EvanOxfeld / node-unzip / lib / parse.js View on Github external
function Parse(opts) {
  var self = this;
  if (!(this instanceof Parse)) {
    return new Parse(opts);
  }

  Transform.call(this, { lowWaterMark: 0 });
  this._opts = opts || { verbose: false };
  this._hasEntryListener = false;

  this._pullStream = new PullStream();
  this._pullStream.on("error", function (e) {
    self.emit('error', e);
  });
  this._pullStream.once("end", function () {
    self._streamEnd = true;
  });
  this._pullStream.once("finish", function () {
    self._streamFinish = true;
  });

  this._readRecord();
}
github chrisdickinson / beefy / lib / scriptinjector.js View on Github external
function ScriptInjectorStream(script, options) {
  var self = this;
  if(!(self instanceof ScriptInjectorStream)) {
    return new ScriptInjectorStream(script, options)
  }

  Transform.call(self, options)

  self._script = script ?
    script+'':
    '('+function() { console.log("You didn't provide a script to inject.") }+')()'
  self.should_inject = true
  self.html_parser = new hp.Parser({
    onprocessinginstruction: function (name, data) {
      self.push('<' + data + '>')
    },
    onopentag: function (name, attribs) {
      var output = ''
      if(name === 'script' && self.should_inject) {
        self.should_inject = false
        output += '
github graalvm / graaljs / graal-nodejs / deps / npm / node_modules / mississippi / node_modules / through2 / through2.js View on Github external
function DestroyableTransform(opts) {
  Transform.call(this, opts)
  this._destroyed = false
}
github danawoodman / starter / node_modules / vinyl-source-stream / node_modules / through2 / through2.js View on Github external
function DestroyableTransform(opts) {
  Transform.call(this, opts)
  this._destroyed = false
}
github svgdotjs / svg.js / node_modules / gulp-jasmine / node_modules / through2 / through2.js View on Github external
function Through2 (override) {
    if (!(this instanceof Through2))
      return new Through2(override)

    this.options = xtend(options, override)

    Transform.call(this, this.options)
  }
github greenish / react-mount / react-mount / node_modules / browserify-shim / node_modules / exposify / node_modules / through2 / through2.js View on Github external
function Through2 (override) {
    if (!(this instanceof Through2))
      return new Through2(override)

    this.options = xtend(options, override)

    Transform.call(this, this.options)
  }
github danawoodman / starter / node_modules / gulp-less / node_modules / through2 / through2.js View on Github external
function DestroyableTransform(opts) {
  Transform.call(this, opts)
  this._destroyed = false
}
github daviddbarrero / Ionic-4-firebase / node_modules / through2 / through2.js View on Github external
function DestroyableTransform(opts) {
  Transform.call(this, opts)
  this._destroyed = false
}