formatstring

2.0.2 • Public • Published

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

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i formatstring

    Weekly Downloads

    3

    Version

    2.0.2

    License

    Beerware

    Last publish

    Collaborators

    • iamthes