Created
November 21, 2015 16:14
-
-
Save bhurlow/279243f279076c00f320 to your computer and use it in GitHub Desktop.
es6 node stream inheritance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var stream = require('stream'); | |
class Transformer extends stream.Transform { | |
constructor(options) { | |
super({ | |
readableObjectMode : true, | |
writableObjectMode: true | |
}); | |
} | |
_transform(chunk, encoding, done) { | |
this.push(chunk.email) | |
done() | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment