Skip to content

Instantly share code, notes, and snippets.

@pgte
Created March 22, 2012 12:30
Show Gist options
  • Save pgte/2158053 to your computer and use it in GitHub Desktop.
Save pgte/2158053 to your computer and use it in GitHub Desktop.
var BufferedStream = require('bufferedstream')
, inherits = require('util').inherits
;
function Transformation(callback) {
BufferedStream.apply(this)
this.callback = callback
}
inherits(Transformation, BufferedStream)
Transformation.prototype.write = function write(d) {
d = this.callback.call({}, d)
BufferedStream.prototype.write.call(this, d)
}
module.exports = Transformation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment