This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

koa-eta
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

koa-eta

A tiny library to bring Eta to Koa.

Install

npm install koa-eta --save

Basic Usage

const Koa = require('koa');
const koaEta = require('koa-eta');

const app = new Koa();

koaEta(app, {
  views: __dirname + '/views'
  // ... other Eta options
  // see https://eta.js.org/docs/api/configuration for more
});

app.use(async ctx => {
  ctx.state = {
    title: 'Koa Eta'
  };

  await ctx.render('index', {
    message: 'Hello World!'
  });
});

Mounting ctx.render

Call koaEta(app, config) with your Koa app and Eta config.

See https://eta.js.org/docs/learn/configuration or https://eta.js.org/docs/api/configuration for parameters to the config object.

License

MIT

/koa-eta/

    Package Sidebar

    Install

    npm i koa-eta

    Weekly Downloads

    1

    Version

    0.1.2

    License

    MIT

    Unpacked Size

    4.16 kB

    Total Files

    5

    Last publish

    Collaborators

    • wrapperup