1.0.0 • Published 7 years ago

yeps-views-template v1.0.0

Weekly downloads
6
License
MIT
Repository
github
Last release
7 years ago

YEPS Views Template

YEPS Template rendering

NPM

npm version Build Status Coverage Status Linux Build Windows Build

Dependency Status devDependency Status NSP Status

License GitHub stars GitHub forks GitHub issues Twitter

How to install

npm i -S yeps-views-template

How to use

own_template_system.js

const template = require('yeps-views-template');
const view = require('template_system');

module.exports = (viewsPath, options = {}) => async context => {
   
    return template(context, async (path, parameters) => view(viewsPath, options)(path, parameters));

};

app.js

const App = require('yeps');
const views = require('own_template_system');

const app = new App();

app.all([
    views(__dirname + '/views');
]);

app.then(async ctx => {
    return ctx.render('index.tpl', { text: 'Hello!' });
});

Links