Skip to content

Instantly share code, notes, and snippets.

@jsdevtom
Last active April 16, 2018 03:25
Show Gist options
  • Save jsdevtom/d98dd218b9d7948d33418ca8ef5f735c to your computer and use it in GitHub Desktop.
Save jsdevtom/d98dd218b9d7948d33418ca8ef5f735c to your computer and use it in GitHub Desktop.
A simple implementation of a node.js transformer class in ES6.
const {Transform} = require('stream')
class UpperCase extends Transform {
_transform (chunk, encoding, done) {
done(null, chunk.toString().toUpperCase())
}
}
module.exports = UpperCase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment