How to use stream-browserify - 4 common examples

To help you get started, we’ve selected a few stream-browserify 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 biosustain / ancestry / jspm_packages / npm / readable-stream@1.1.14 / lib / _stream_writable.js View on Github external
function Writable(options) {
    var Duplex = require("./_stream_duplex");
    if (!(this instanceof Writable) && !(this instanceof Duplex))
      return new Writable(options);
    this._writableState = new WritableState(options, this);
    this.writable = true;
    Stream.call(this);
  }
  Writable.prototype.pipe = function() {
github biosustain / ancestry / jspm_packages / npm / readable-stream@1.1.14 / lib / _stream_readable.js View on Github external
function Readable(options) {
    var Duplex = require("./_stream_duplex");
    if (!(this instanceof Readable))
      return new Readable(options);
    this._readableState = new ReadableState(options, this);
    this.readable = true;
    Stream.call(this);
  }
  Readable.prototype.push = function(chunk, encoding) {
github hdmchl / NaiveBayesClassifier / src / learn.js View on Github external
export function createLearnStreamForCategory(category) {
	return Stream ? new Stream.Writable({
		decodeStrings: false,
		write: function write(chunk, encoding, next) {
			var text = chunk.toString('utf8');

			this.learn(text, category);

			next();
		}.bind(this)
	}) : undefined;
};
github biosustain / ancestry / jspm_packages / npm / readable-stream@1.1.14 / lib / _stream_readable.js View on Github external
Readable.prototype.on = function(ev, fn) {
    var res = Stream.prototype.on.call(this, ev, fn);
    if (ev === 'data' && false !== this._readableState.flowing) {
      this.resume();
    }
    if (ev === 'readable' && this.readable) {
      var state = this._readableState;
      if (!state.readableListening) {
        state.readableListening = true;
        state.emittedReadable = false;
        state.needReadable = true;
        if (!state.reading) {
          var self = this;
          process.nextTick(function() {
            debug('readable nexttick read 0');
            self.read(0);
          });
        } else if (state.length) {

stream-browserify

the stream module from node core for browsers

MIT
Latest version published 4 years ago

Package Health Score

71 / 100
Full package analysis