node-modules-webant-handler-hbs
Require handlebars templates with webant
Installation
$ npm install webant-handler-hbs
Usage
Ensure the hbs
handler is present in your webant configuration file. For example:
You may now require
handlebars files:
var tmpl = ;var otherTmpl = ;var html = ;
Settings
The following configuration settings are available:
requireRuntime
Can be either true
(default) or false
. If true
, the handlebars runtime is automatically require
d along with the template. This allows easier usage of the template as follows:
var tmpl = ;var html = ;
If set to false
, you'll need to include the handlebars runtime yourself as follows:
var hbs = ;var tmpl = ;var tmplFunc = hbs'default';var html = ;
It may be necessary to modify the handlebars runtime to export the Handlebars object by appending the following line:
// Handlebars code...moduleexports = Handlebars;
Tests
Ensure phantomjs is installed and in your PATH, then run:
$ npm test