Skip to content

Instantly share code, notes, and snippets.

@dlmanning
Created August 8, 2014 16:59
Show Gist options
  • Save dlmanning/f05d9bf1c79f72ae1092 to your computer and use it in GitHub Desktop.
Save dlmanning/f05d9bf1c79f72ae1092 to your computer and use it in GitHub Desktop.
var { Transform } = require('stream'); // use require for non-ES6 Node modules
class MyStream extends Transform {
constructor (options) {
super({
lowWaterMark: 0,
encoding: 'utf8'
});
}
_transform(chunk, encoding, cb) {
this.push(String(chunk).toUpperCase());
cb();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment