Skip to content

jakub-swierk/js-koa-pug

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

js-koa-pug

Koa 2 middleware for rendering pug templates.

Installation

npm install --save js-koa-pug

API

pug(root, options)

  • root: Path to your views.
  • options Default render options see pug documentation for more.

context.render(file, options)

  • file: Path relative to root, without .pug extension.
  • options Overrides default options.

Example

var pug = require("js-koa-pug");

app.use(pug("views"));

app.use(function(ctx) {
  ctx.render("index");
});

Hint

For production environments its nice to have cache option enabled.

License

MIT, see more in LICENSE file.

About

Koa 2 middleware for rendering pug templates.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published