Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (14 sloc) 451 Bytes
BufferStream = require 'bufferstream'
streamify = require 'dt-stream'
##
# useful for rendering a template directly into a response:
# render(new Template(schema:'html5', body).pipe(res))
render = (template) ->
buffer = new BufferStream
encoding:'utf-8' # FIXME use template.options.encoding
size:'flexible'
disabled:yes
streamify(template).stream.pipe(buffer)
return buffer
# exports
module.exports = render
Jump to Line
Something went wrong with that request. Please try again.