JSPM

kyber

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q32896F
  • License MIT

A directive template engine for Node.js

Package Exports

  • kyber

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (kyber) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

KyberJS

NPM travis

A directive template engine for Node.js

中文文档

Fetures

  • Front-end HTML DOM directive driver;
  • Templates support asynchronous functions based on async, await;
  • Built-in support for HTML minify;
  • Friendly APIs, flexible extensions, support for custom directives, filters, tags;

Support

  • Node 8+

Install

  • Use npm to install
npm install --save kyber

Usage

Simple for file rendering;

const kyber = require('kyber');

const init = async function init() {
    const res = await kyber.render('template.html', {list: ['<hr/>', 'foo', 'bar'], title: 'Hello Kyber'});
    console.log(res);
};

init();

Use with Koa

const Koa = require('koa');
const kyber = require('kyber');

const app = new Koa();

app.use(async ctx => {
    ctx.body = await kyber.render('index.html');
});

app.listen(3000);

API and template syntax

See here;

Contribute

KyberJS is still in development, and if you have problems using KyberJS, or if you have a good suggestion, please open a Issue or make a Pull Request.

License

MIT