mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-16 04:40:39 -07:00
feat: renderFileToNodeStream(filepath, scope)
This commit is contained in:
@@ -10,7 +10,8 @@ import { KeepingTypeEmitter } from '../emitters/keeping-type-emitter'
|
||||
export class Render {
|
||||
public renderTemplatesToNodeStream (templates: Template[], ctx: Context): NodeJS.ReadableStream {
|
||||
const emitter = new StreamedEmitter()
|
||||
toThenable(this.renderTemplates(templates, ctx, emitter)).then(() => emitter.end())
|
||||
toThenable(this.renderTemplates(templates, ctx, emitter))
|
||||
.then(() => emitter.end(), err => emitter.error(err))
|
||||
return emitter.stream
|
||||
}
|
||||
public * renderTemplates (templates: Template[], ctx: Context, emitter?: Emitter): IterableIterator<any> {
|
||||
|
||||
Reference in New Issue
Block a user