import {
CompiledTemplate,
Runtime,
TemplateProvider,
} from '@tarik02/bladejs';
const templateProvider: TemplateProvider = {
async getTemplateCompiledFile(name: string): Promise<CompiledTemplate | undefined> {
// TODO: Load template, return undefined if does not exist
},
async isOutdated(name: string, template: CompiledTemplate, creationTime: number): Promise<boolean> {
// TODO: Return true if template is outdated (this will cause to {getTemplateCompiledFile} call)
},
};
const runtime = new Runtime([templateProvider]);
(async () => {
for await (const chunk of runtime.render('test')) {
process.stdout.write(chunk);
}
})();