bauer-plugin-render
v0.2.1
Published
Plugin for bauer to render templates.
Downloads
2
Maintainers
Readme
node-bauer-plugin-render
Plugin for bauer
to render templates.
Installation
npm install bauer-plugin-render
Usage
The popular underscore
module is used internally to compile templates.
module.exports = function(promise) {
return promise.render(__dirname + "/template.jst",{
values: {
name: "Yuri Neves",
age: "30"
},
target: "output.html"
})
.then(function(file) {
// file === output.html
});
};
module.exports = function(promise) {
return promise.return({
values: {
name: "Yuri Neves",
age: "30"
},
target: "output.html"
})
.render(__dirname + "/template.jst")
.then(function(file) {
// file === output.html
});
};
module.exports = function(promise) {
return promise.return(__dirname + "/template.jst")
.return({
values: {
name: "Yuri Neves",
age: "30"
},
target: "output.html"
})
.then(function(file) {
// file === output.html
});
};
Configuration
{
workers: 1,
slots: 1,
delay: 0,
options: { // default options for underscore.templateSettings
}
}
API Summary
Promise
.render(source String) :Promise
.render(options Object) :Promise
.render(source String, options Object) :Promise