1.0.8 • Published 3 years ago

js-koa-pug v1.0.8

Weekly downloads
19
License
MIT
Repository
-
Last release
3 years ago

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.

1.0.8

3 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.4

6 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago