connectivedx / Phoenix

http://connectivedx.github.io/Phoenix/
33 stars 5 forks source link

Adds JS module to support (very) simple, string based templating #169

Closed elseloop closed 8 years ago

elseloop commented 8 years ago

(From #160, opened against master by @stoff:)

Module contains a constructor for a Template object, and exposes a method to get back a new Template object.

I've not added any requires for the module since it should be optional.

example usage:

var createTemplate = require('./modules/Template.js').createTemplate;
var templateFooBar = createTemplate('Replace this %foo% with %bar%');

console.log(templateFooBar.populate({foo: 'bar', bar: 'foo'}));