Miss any of our Open RFC calls?Watch the recordings here! »

@tarik02/bladejs-compiler

2.2.0 • Public • Published

bladejs-compiler

TravisCI Build Status AppVeyor Build Status npm version

Installation

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

Usage

import {
  AbstractError,
  Compiler,
  Source,
} from '@tarik02/bladejs-compiler';
 
const compiler = new Compiler();
compiler.addDefaults();
 
const source = `
<div class="alert alert-danger">
    <div class="alert-title">{{ title }}</div>
 
    {{ slot }}
</div>
`.trim();
const filename = 'test.bjs';
 
const source = new Source(source, filename);
let compiled: string;
 
try {
  compiled = compiler.compile(source);
} catch (e) {
  if (e instanceof AbstractError) {
    process.stdout.write(e.prettyPrint());
    process.exit(-1);
  }
 
  throw e;
}

Install

npm i @tarik02/bladejs-compiler

DownloadsWeekly Downloads

0

Version

2.2.0

License

MIT

Unpacked Size

229 kB

Total Files

131

Last publish

Collaborators

  • avatar