tr.js 296 B

123456789101112
  1. var through = require('through2');
  2. module.exports = function (file, opts) {
  3. var data = '';
  4. return through(write, end);
  5. function write (buf, enc, next) { data += buf; next() }
  6. function end () {
  7. this.push(data.replace(/X/g, opts.x));
  8. this.push(null);
  9. }
  10. };