feat: renderFileToNodeStream(filepath, scope)

This commit is contained in:
harttle
2021-10-03 21:21:25 +08:00
parent dd325362f9
commit 68c4cfcfb6
7 changed files with 107 additions and 4 deletions
+4
View File
@@ -84,6 +84,10 @@ export class Liquid {
const templates = this.parseFileSync(file)
return this.renderSync(templates, ctx)
}
public async renderFileToNodeStream (file: string, scope?: object) {
const templates = await this.parseFile(file)
return this.renderToNodeStream(templates, scope)
}
public _evalValue (str: string, ctx: Context): IterableIterator<any> {
const value = new Value(str, this)