Skip to content

Instantly share code, notes, and snippets.

@mafintosh
Created May 5, 2020 13:40
Show Gist options
  • Save mafintosh/9796f7ecdc22e536efe7b15ccd7c6637 to your computer and use it in GitHub Desktop.
Save mafintosh/9796f7ecdc22e536efe7b15ccd7c6637 to your computer and use it in GitHub Desktop.
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