Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @tarik02/bladejs with all npm packages installed. Try it out:

var bladejs = require("@tarik02/bladejs")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@tarik02/bladejs v2.2.0

Laravel's blade templating engine for JavaScript and TypeScript.

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);
  }
})();
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free