Created
August 13, 2016 21:01
-
-
Save timwis/b317754958319ddf72f99fbddcf164e1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 htmlIndex = require('simple-html-index') | |
const BufferList = require('bl') | |
function createPage (title) { | |
const html = htmlIndex({ title }) | |
const htmlBuffer = html.pipe(BufferList()) | |
return function flush () { | |
// return htmlBuffer // works | |
return htmlBuffer.duplicate() // doesn't work (empty) | |
} | |
} | |
const page = createPage('Hello') | |
page().pipe(process.stdout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment