0.1.3 • Published 9 years ago

tmplt v0.1.3

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

tmplt.js npm Version Build Status Coverage Status

Minimal templating for JavaScript.

Usage

var tmpl = '{ foo }, { bar.baz }!';
var data = {
  foo: 'Hello',
  bar: {
    baz: 'World'
  }
};

tmplt(tmpl)(data); //=> 'Hello, World!'

API

tmplt(tmpl)(data)

Returns a String, the result of interpolating data into tmpl.

  • tmpl The template String.
  • data An Object literal of values.

Installation

Install via npm:

$ npm i --save tmplt

Install via bower:

$ bower i --save yuanqing/tmplt

To use tmplt in the browser, include the minified script in your HTML:

<body>
  <!-- ... -->
  <script src="path/to/tmplt.min.js"></script>
  <script>
    // tmplt available here
  </script>
</body>

Changelog

  • 0.1.0
    • Initial release

License

MIT license