render-then
v1.0.0
Published
promise-based template rendering for ES7, koa, co and others
Downloads
5
Readme
Promise based template rendering using consolidate.js.
Options
map
an object mapping extension names to engine names [{}
]default
default extension name to use when missing [html
]cache
cached compiled functions [NODE_ENV !== 'development']
Example
let render = require('render-then');
let renderer = render('views', {
map: {
html: 'swig'
}
});
renderer('user', {
user: {
name: 'haoxin'
}
}).then(function(res) {
console.log(res);
}).catch(function(err) {
console.error(err);
});
License
MIT