koa-art-template

1.1.1 • Public • Published

koa-art-template

NPM Version Node.js Version

Koa art-template view render middleware. support all feature of art-template.

Install

npm install --save art-template
npm install --save koa-art-template

Usage

Example

const Koa = require('koa');
const render = require('koa-art-template');
 
const app = new Koa();
render(app, {
  root: path.join(__dirname, 'view'),
  extname: '.art',
  debug: process.env.NODE_ENV !== 'production'
});
 
app.use(async function (ctx) {
  await ctx.render('user');
});
 
app.listen(8080);

Or you can checkout the example.

Options

Supports art-template options.

State

Support ctx.state in koa.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.1.1
    273
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.1.1
    273
  • 1.1.0
    1
  • 1.0.0
    2
  • 0.0.2
    1
  • 0.0.1
    2

Package Sidebar

Install

npm i koa-art-template

Weekly Downloads

199

Version

1.1.1

License

MIT

Last publish

Collaborators

  • aui