Created
September 13, 2018 17:14
-
-
Save bennidi/bf69ddf1a23eb0c9dd1c26e304bf6b5e to your computer and use it in GitHub Desktop.
Node.js: Composing multiple streams into one
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
import string_stream from 'string-to-stream' | |
import multi_stream from 'multistream' | |
ctx.status = 200 | |
ctx.body = multi_stream | |
([ | |
string_stream(before_content), | |
typeof content === 'string' ? string_stream(content) : content, | |
string_stream(after_content) | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment