0.1.5 • Published 8 years ago

express-bemhtml-priv.js v0.1.5

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

Express-bemhtml-priv.js

Simple render engine for express with bemhtml and priv.js technologies

var engine = require('express-bemhtml-priv.js');
engine.init(app, {
    bemhtml: 'path/to/bemhtml/file',
    priv: 'path/to/priv.js/file'
});

...
engine.render('blocks["market"]', [args, ])
    .then(function (tmpl) {
        res.send(tmpl);
    });;

API

/**
 * Initialization funciton to bind engine to application and point pathes to templates
 *
 * @param {Object} app, express instance
 * @param {Object} opts
 *  @key {String} bemhtml - path to bemhtml template file
 *  @key {String} priv - path to priv template file
 *
 * All options are required
 */
function init(app, opts)
/**
 * Render function that returns promise
 *
 * @param {Function} privFn, function in global scope for priv.js
 * @param {Array} args, array of arguments for privFn, executed as privFn.apply(args);
 *
 */
function render(privFn, args);
0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago