subs
v1.0.2
Published
tiny string substitution
Downloads
43
Maintainers
Readme
subs
tiny string substitution
Installation
Install with component(1):
$ component install matthewmueller/subsInstall with npm:
$ npm install subsExample
// 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' });Test
make testLicense
MIT
