gulp-mustache-plus
mustache plugin for gulp
Forked from gulp-mustache to add some features.
Usage
First, install gulp-mustache-plus
as a development dependency:
npm install --save-dev gulp-mustache-plus
Then, add it to your gulpfile.js
:
var mustache = ; gulp ;
You may also pass in an object representing mustache partials and their contents
as a third argument to the call to mustache()
like so:
gulp ;
With gulp-mustach-plus, you also can use file in partials:
gulp ;
API
mustache(view, options, partials)
view
Type: hash
or string
Default: undefined
The view object, containing all template variables as keys. If you pass a string
it will be used as the path to a JSON file containing view variables.
options
Type: hash
Default: { extension: '.html' }
The options object to configure the plugin.
options.extension
Type: string
Default: .html
options.file_prepend
Type: string
Default: ``
Prepend each partial file with a string (e.g., useful to add \n
before each file insertion).
partials
Type: hash
Default: {}
An optional object of mustache partial strings. See mustache.js for details on partials in mustache.