https://github.com/cdata/handlebars-amd
NodeJS module that helps you compile Handlebars templates into AMD modules.
https://github.com/cdata/handlebars-amd
Last synced: 7 months ago
JSON representation
NodeJS module that helps you compile Handlebars templates into AMD modules.
- Host: GitHub
- URL: https://github.com/cdata/handlebars-amd
- Owner: cdata
- Created: 2012-05-07T22:07:22.000Z (over 13 years ago)
- Default Branch: master
- Last Pushed: 2012-05-07T22:37:16.000Z (over 13 years ago)
- Last Synced: 2025-02-02T00:32:01.422Z (about 1 year ago)
- Language: JavaScript
- Size: 88.9 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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
```sh
# For command line:
npm install -g handlebars-amd
# For Node apps:
npm install handlebars-amd
```
## Usage
On the command line:
```sh
handlebars-amd -i ./my/templates -n 'app/templates' -m
```
In your web server:
```javascript
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!
});
```