Get unlimited public & private packages + team-based management with npm Teams.Learn more »

koa-views-render

0.0.1 • Public • Published

koa-views-render

code style styled with prettier made with lass license

Simple render(page, locals) middleware for Koa and Lad (uses koa-views).

Table of Contents

Install

npm:

npm install @ladjs/koa-views-render

yarn:

yarn add @ladjs/koa-views-render

Usage

This is a simple middleware that simply passes down to ctx.render the page and locals arguments you provide.

For example render(page,locals) will get passed to ctx.render(page,locals). See koa-views for full reference.

const render = require('koa-views-render');
 
// ...
 
app.use(render('home'));

With optional locals object argument:

app.use(render('about', title: 'About Us' });

Contributors

Name Website
Nick Baugh http://niftylettuce.com/

License

MIT © Nick Baugh

Install

npm i koa-views-render

DownloadsWeekly Downloads

60

Version

0.0.1

License

MIT

Last publish

Collaborators

  • avatar