Plato on Github
Report Home
ampersand/lib/app/transformStream.js
Maintainability
81.69
Lines of code
20
Difficulty
7.72
Estimated Errors
0.17
Function weight
By Complexity
By SLOC
var fs = require('fs'), stream = require('stream'), stream2 = require('readable-stream'), processString = require('./processString'), Transform = stream.Transform || stream2.Transform; function EncodeStream(data) { this.templateData = data; Transform.call(this); } EncodeStream.prototype = Object.create(Transform.prototype, { constructor: { value: EncodeStream } }); EncodeStream.prototype._transform = function (chunk, encoding, callback) { chunk = chunk.toString(); this.push(processString(chunk, this.templateData)); callback(); }; module.exports = EncodeStream;