Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created October 1, 2012 21:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save isaacs/3814458 to your computer and use it in GitHub Desktop.
Save isaacs/3814458 to your computer and use it in GitHub Desktop.
'use strict';
// a passthrough stream.
// basically just the most minimal sort of Transform stream.
// Every written chunk gets output as-is.
module.exports = PassThrough;
var Transform = require('./transform.js');
var util = require('util');
util.inherits(PassThrough, Transform);
function PassThrough(options) {
Transform.call(this, options);
}
PassThrough.prototype._transform = function(chunk, output, cb) {
output(chunk);
cb();
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment