Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
NodeJS module that helps you compile Handlebars templates into AMD modules.
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
test
.gitignore
README.md
package.json

README.md

Handlebars AMD

Handlebars is a cool template system that allows you to precompile your templates as JavaScript for great performance. One thing that Handlebars could stand to play nicely with is AMD module loaders (like RequireJS and CloudFlareJS). This node module allows you to compile entire directories of Handlebars templates (recursively) into a named AMD module.

Installing

# For command line:
npm install -g handlebars-amd

# For Node apps:
npm install handlebars-amd

Usage

On the command line:

handlebars-amd -i ./my/templates -n 'app/templates' -m

In your web server:

require('handlebars-amd').compile(
    './my/templates', // Template directory.. 
    'app/templates', // Resulting module name.. 
    true // Minify!
).then(function(compiled) {

    // Compiled is a string of JavaScript that contains your module!
});
Something went wrong with that request. Please try again.