handlebars-amd

0.0.1 • Public • Published

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!
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    2
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    2

Package Sidebar

Install

npm i handlebars-amd

Weekly Downloads

2

Version

0.0.1

License

none

Last publish

Collaborators

  • cdata