String formatter utility for Javascript
npm install rfs-string-formatter
const formatter = require("rfs-string-formatter");
`
Supported functions
$3
Formats the template string using the args provides. Args can be different arguments or an array of values
`
formatter.format("String to be {0} and {1}", "formatted", "parsed")
`
OR
`
formatter.format("String to be {0} and {1}", ["formatted", "parsed"])
`
$3
Formats the template string using the argObjec keys and their values
`
formatter.formatReplace("Today is {day} and the year is {year}", { day: "Monday", year: "2018" });
// Today is Monday and the year is 2018
``