formatstring
v2.0.2
Published
C# style string format.
Downloads
15
Readme
formatstring
Simple C# style format function.
Install
npm install --save formatstring
Examples
var format = require("formatstring");
var params = {
first: "John",
info: {
age: 29
}
};
var pattern = "Hello, this is {first}, I'm {info.age}.";
var output = format(pattern, params);
console.log(output); // Hello, this is John, I'm 29.
If you don't use nested values, you can use formatstring
v1 for faster parsing.
npm install formatstring@1
Similar projects
- https://github.com/sindresorhus/pupa