subs

tiny string substitution

npm install subs
2 downloads in the last week
4 downloads in the last month

tpl

tiny string substitution

Example

// subs(tpl, obj)
var tpl = 'my favorite {food} is: {name}';
var str = subs(str, { food: 'fruit', name: 'peach' });

// currying: subs(tpl)(obj)
var tpl = 'my favorite {food} is: {name}';
var fn = subs(tpl);
var str = fn({ food: 'fruit', name: 'peach' });

Installation

Install with component(1):

$ component install matthewmueller/tpl

Test

make test

License

MIT

npm loves you