1.0.0 • Published 10 years ago
mustache-cache v1.0.0
mustache-cache
Compile mustache templates into a requirable, callable function.
Installation
$ npm install -g mustache-cacheUsage
Usage: mustache-cache <template-file> [options]
Options:
-h, --help output usage information
-V, --version output the version number
-o, --outfile <file> Write cached template to this file. If unspecified, prints to stdoutExample
Given the file sayhi.tmpl:
Hello {{name}}To compile, run the following
$ mustache-cache sayhi.tmpl -o sayhi.tmpl.jsUsing The Compiled Template
Require it like any local module file:
var sayhiTmpl = require('./sayhi.tmpl');
var rendered = sayhiTmpl({name: 'Jess'});
console.log(rendered);Note: The compiled template requires mustache to work. Ensure you have it
installed in your project with npm install --save mustache
Contributing
Pull Requests are welcome!
This is a truly open open source project: If your contributions are of a high quality, I will give you push permissions to make direct changes in the future.
Support Development
If you like this module, consider buying me a beer with Bitcoin:
1.0.0
10 years ago
