var through = require('through2');
var stream = through(write, end);
var tr =function write(buffer,encoding, next) {
this.push(buffer.toString().toUpperCase());
next();
}
process.stdin.pipe(through(tr)).pipe(process.stdout);
I am getting error
var stream = through(write, end);
^
ReferenceError: write is not defined at Object. (C:\Users\GOTHAMI\stream\transform.js:2:22) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Function.Module.runMain (module.js:441:10) at startup (node.js:134:18) at node.js:962:3
write
is not defined. – rrk