1.0.0 • Published 3 months ago

string-prototype-format-js v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

string-prototype-format-js

Latest Version Licence GitHub Tests Action Status Downloads

string-prototype-format-js is a NPM Package 'String.prototype' extension to format a string replacing variables.

Installation

# In your terminal, enter command:
npm install string-prototype-format-js

Usage

Example

require("string-prototype-format-js");

var str = "Hello I'm % and I'm % years old.";
var formatted = str.format(["John", 24]);

console.log(formatted);
// Output: "Hello I'm John and I'm 24 years old."

Function notice

"string...".format([...args]: string[], varType?: string): string
ParamsTypeDescription
argsString[]Value of each variable in the same order initiated in the String
varTypeStringWhere to put each value (Default: $)

Contributing

If you are interested in this project and want to improve it, fix errors or bugs, you're welcome to contribute.

Credits

Licence

The MIT License (MIT).

!Note Please see License File for more information.