0.0.5 • Published 6 years ago

rfs-string-formatter v0.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

string-formatter

String formatter utility functions for Javascript

How to use

Import into your file

const formatter = require("rfs-string-formatter"); 

Supported functions

format(template, args)

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"])

formatReplace(template, argObj)

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
0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago