Skip to content

Instantly share code, notes, and snippets.

View guymguym's full-sized avatar

Guy Margalit guymguym

  • IBM
View GitHub Profile
@guymguym
guymguym / pipeline.js
Created October 13, 2020 08:28
node.js stream.pipeline error propagation vs. using pipes
'use strict';
const util = require('util');
const stream = require('stream');
const assert = require('assert');
const finished_async = util.promisify(stream.finished);
const pipeline_async = util.promisify(stream.pipeline);
const delay_async = util.promisify(setTimeout);
const inspect_readable_state = readable => util.inspect(readable._readableState, {
/* jshint browser:true */
'use strict';
var debug = require('debug');
debug.disable("*");
// debug.enable("*");
var Peer = require('simple-peer');
var Q = require('q');
var _ = require('lodash');