justjst

0.0.3 • Public • Published

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.

Package Sidebar

Install

npm i justjst

Weekly Downloads

1

Version

0.0.3

License

GPLv3

Last publish

Collaborators

  • enet