egg-view-htmling

1.0.2 • Public • Published

egg-view-htmling

egg view plugin for htmling.

Install

$ npm i egg-view-htmling --save

Usage

// {app_root}/config/plugin.js
exports.htmling = {
  enable: true,
  package: 'egg-view-htmling',
};
 
// {app_root}/config/config.default.js
exports.view = {
  mapping: {
    '.html': 'htmling',
  },
};
 
// htmling config
exports.htmling = {};

Create a htmling file

// app/view/hello.html
hello {{data}}

Render it

// app/controller/render.js
exports.htmling = async ctx => {
  await ctx.render('hello.html', {
    data: 'world',
  });
};

License

MIT

Package Sidebar

Install

npm i egg-view-htmling

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

3.5 kB

Total Files

6

Last publish

Collaborators

  • jiamao