0.0.3 • Published 9 years ago
justjst v0.0.3
justjst
The easiest template engine to compile javascript templates. The module returns template-function, which could be executed any moment and returns the final string.
Are there some options? No. All you can use is constructions like <? echo('9 + 16 = 25') ?>
and <?= 2 * 2 === 4 ?>
.
Usage example
You may use this module both with Node.js or in the browser.
'use strict';
let justjst = require('justjst'),
template = justjst('Hello, <? echo(name) ?>!\n2 * 2 = <?= x ?>');
console.log(template({
x: 4,
name: 'world'
}));
/*
Hello, world!
2 * 2 = 4
*/
You may find an example of real use here.