Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jeromeetienne/shorttag.js

javascript template engine - micro framework - 20 lines
https://github.com/jeromeetienne/shorttag.js

Last synced: about 1 month ago
JSON representation

javascript template engine - micro framework - 20 lines

Awesome Lists containing this project

README

        

# ShortTag.js

This is a basic templating system in node.js

* based on php shorttag/longtag
* *super simple* and *immediatly understandable*

## TODO

* make a demo in browser and in node
* warning for user input sanatization
* shorttag.js doesnt do user input sanatization for you. If your data is coming
from a untrusted user, it is up to you to sanatize them.

### To install

npm install shorttag

### example

Suppose you get the template being

> Let do an addition = 1+5 ?>
> Let do an addition = 1+5 ?>
> isnt that console.log("super") ?>?

The result gonna be

> Let do an addition 6
> isnt that super?