mustache-cache

1.0.0 • Public • Published

mustache-cache

NPM

Compile mustache templates into a requirable, callable function.

Installation

$ npm install -g mustache-cache

Usage

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 stdout

Example

Given the file sayhi.tmpl:

Hello {{name}}

To compile, run the following

$ mustache-cache sayhi.tmpl -o sayhi.tmpl.js

Using 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:

3E9wqzjZSCdfpSSLqH5uL7FBrLFvqn58X8

3E9wqzjZSCdfpSSLqH5uL7FBrLFvqn58X8

Readme

Keywords

none

Package Sidebar

Install

npm i mustache-cache

Weekly Downloads

2

Version

1.0.0

License

ISC

Last publish

Collaborators

  • jesstelford