1.0.1 • Published 9 years ago

lite-tpl v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
9 years ago

lite.js

A very tiny full featured template engine for javascript for both client and server sides, you need no-learning curve

features

instead of <? ... ?> we use {{ ... }}
instead of <?= ... ?> we use {{= ... }}
supports any javascript code
very tiny, just a function with 18 lines of code works for both client-side 'browsers' and server-side 'node.js' small footprints easily embed javascript in your html

usage

html =  "hi {{= name }} ok <br />" +
      	"lets do a loop" +
      	"{{ for ( i in [1, 2, 3, 4] ) { }} " +
        "	current step is {{= i }}" +
      	"{{ } }}" + // endfor '}'
      	" end-of-loop "

console.log(lite(html, {name: "alash3al"}))