So I have really useful Transform stream instance called:let foo = makeStream() /* from a 3rd party library */ I can happily do:process.stdin.pipe(foo).pipe(...) I'd like to extend the capabilities of foo in my own Transform class:class MyFooExtensions extends Transform { constructor() { /* ??? */ } _transform(chunk, enc, cb) { /* ???? */ } } The author "makeStream()" didn't provide a class interface that could be extended, only an object. How can I write a class that uses "foo" but adds other features?Thanks!!!
Submitted March 15, 2019 at 04:38AM by manchegoo
No comments:
Post a Comment