Last active
December 20, 2015 14:19
-
-
Save brycebaril/6145578 to your computer and use it in GitHub Desktop.
A Transform type constructor possible extension for through2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Transform = require("stream").Transform | |
var inherits = require("util").inherits | |
module.exports.ctor = function ctor(fn) { | |
function T(options) { | |
if (!(this instanceof T)) return new T(options) | |
Transform.call(this, options) | |
} | |
inherits(T, Transform) | |
T.prototype._transform = fn | |
return T | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment