3.0.0 • Published 3 years ago

@tarik02/bladejs v3.0.0

Weekly downloads
3
License
MIT
Repository
github
Last release
3 years ago

bladejs

TravisCI Build Status AppVeyor Build Status npm version

Installation

$ yarn add @tarik02/bladejs
# or
$ npm install --save @tarik02/bladejs

Usage

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);
  }
})();