Skip to content

Instantly share code, notes, and snippets.

@fakenickels
Created June 19, 2014 19:37
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save fakenickels/2949a14142ca87bf6e51 to your computer and use it in GitHub Desktop.
The most simple template engine
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