Awesome string formatting using shell style place holders.
npm install --save fmtr
Parameters:
format
string with${propertyName}
placeholder(s) wherepropertyName
is the name of a property ofobj
obj
an object containing values to substitute into the format string.
Returns:
- string
"use strict";
var fmtr = require('fmtr');
var user = {
username: 'alice',
spouse: 'bob',
enemy: 'eve'
};
console.log(fmtr('${username} is married to ${spouse} and hates ${enemy}', user));
// prints "alice is married to bob and hates eve"
npm test
See LICENSE.md