Created
December 3, 2015 23:33
-
-
Save drzax/4245cc8d6f9abec02d5f to your computer and use it in GitHub Desktop.
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
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