kiss-tpl 💋
lightweight, simple and powerful javascript template engine
verry simple template engine use ES6 - Template literals to render all type of pain text (HTML, json, email, code generater etc.)
Features
- ✅ nodejs support.
- ✅ browsers support.
- ✅ well tested.
- ✅ supper lightweight.
- ✅ supper easy.
- ✅ powerful.
- ✅ have every things that a template engine need.
- ❌ no dependentce required.
- ❌ no extra options.
- ❌ nothing to learn.
Install
you can install from npm
by:
npm install kiss-tpl --save
or from github:
git clone https://github.com/minhlucvan/kiss-tpl.git
usage
Just like template literals, no it's template literals.
; let context = thing: "world" ; let kiss`hello `; console; // hello world
pretty easy right!
let me show you something cool
conditional blocks
there is no if
- else
here but you can do this instead.
let context = isFine: true ; let kiss` A: hello, how are you today? B: hi, . `;
es6 is amazing.
array render
of course there is no for
, but you can use map
let context = frieds: "Bob" "julia" "Ren" "Samath" ; let kiss` I have many friends like `;
let put some function
you can also put a function callback like this.
{ return one + other; } let context = one: 3 other: 1 ; let kiss` + = `;
thank for reading and happy coding.