2.0.2 • Published 7 years ago

formatstring v2.0.2

Weekly downloads
7
License
Beerware
Repository
github
Last release
7 years ago

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