Created
June 19, 2014 19:37
-
-
Save fakenickels/2949a14142ca87bf6e51 to your computer and use it in GitHub Desktop.
The most simple template engine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function tmpl(text, o){ | |
return text.replace(/({(.+)})/gm, function( exp, conj, innerExp ){ | |
return eval(innerExp); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment