Created
May 5, 2020 13:40
-
-
Save mafintosh/9796f7ecdc22e536efe7b15ccd7c6637 to your computer and use it in GitHub Desktop.
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
const Duplexify = require('duplexify') | |
const clone = require('cloneable-readable') | |
class PassthroughWritable extends Duplexify { | |
constructor (ws) { | |
super() | |
const pt = new stream.PassThrough() | |
this.setWritable(stream.pipeline(pt, ws)) | |
this.setReadable(clone(pt)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment