Skip to content

Instantly share code, notes, and snippets.

@fakenickels
Created June 19, 2014 19:37
Show Gist options
  • Save fakenickels/2949a14142ca87bf6e51 to your computer and use it in GitHub Desktop.
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