Koa 2 middleware for rendering pug templates.
npm install --save js-koa-pug
root
: Path to your views.options
Default render options see pug documentation for more.
file
: Path relative to root, without.pug
extension.options
Overrides default options.
var pug = require("js-koa-pug");
app.use(pug("views"));
app.use(function(ctx) {
ctx.render("index");
});
For production environments its nice to have cache option enabled.
MIT, see more in LICENSE file.