jstools-template

0.1.2 • Public • Published

jEngine: $template wercker status

Bower version npm version Build Status Installation

npm install jstools-template --save

or

bower install jstools-template --save

Usage

var data = {
  foo: 'bar',
  crash: {
    test: 'dummy'
  },
  list: ['foo', 'bar', 'foobar'],
  map: {
    hi: 'all',
    bye: 'nobody'
  },
  template: 'sample',
  label: {
    cancel: 'cancel'
  }
};
 
$template.compile('$if{ foo === "bar" }gogogo{:}whoops{/}')(data)
// returns 'gogogo'
 
$template.compile('$each{ item, key in map }[${foo}:${key}:${item}]{/}')(data);
// returns '[bar:hi:all][bar:bye:nobody]'

Readme

Keywords

Package Sidebar

Install

npm i jstools-template

Weekly Downloads

4

Version

0.1.2

License

MIT

Last publish

Collaborators

  • gsusgz