1.1.4 • Published 3 years ago
fmtr v1.1.4
fmtr
Awesome string formatting using shell style place holders.
Installation
npm install --save fmtrAPI
fmtr(format, obj)
Parameters:
formatstring with${propertyName}placeholder(s) wherepropertyNameis the name of a property ofobjobjan object containing values to substitute into the format string.
Returns:
- string
Example
"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"Testing
npm testLicense
See LICENSE.md