index.js
function sprintf (fstr, array) {
  // check the formatted string is for JSON and confirm is a valid JSON
  array.forEach(function (value) {
    fstr = format(fstr, value);
  });
  return fstr;
}
function sprintf (fstr, array) {
  // check the formatted string is for JSON and confirm is a valid JSON
  array.forEach(function (value) {
    fstr = format(fstr, value);
  });
  return fstr;
}
HELP FUNCTIONS format string from array source