Skip to content

Instantly share code, notes, and snippets.

@drzax
Created December 3, 2015 23:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drzax/4245cc8d6f9abec02d5f to your computer and use it in GitHub Desktop.
Save drzax/4245cc8d6f9abec02d5f to your computer and use it in GitHub Desktop.
module.exports = function template(tmpl, data){
return tmpl.replace(/\{(\w*)\}/g,function(m,key){return data.hasOwnProperty(key)?data[key]:"";});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment