subs

1.0.2 • Public • Published

subs

tiny string substitution

Installation

Install with component(1):

$ component install matthewmueller/subs

Install with npm:

$ npm install subs

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' });

Test

make test

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.2
    14
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.2
    14
  • 1.0.1
    4
  • 1.0.0
    3
  • 0.0.1
    1

Package Sidebar

Install

npm i subs

Weekly Downloads

13

Version

1.0.2

License

MIT

Last publish

Collaborators

  • mattmueller