@wtasnorg/node-lib / format
format(
fmt,obj):string
Defined in: src/format.ts:27
Replace {key} placeholders in fmt with values from obj.
Keys that do not exist in obj are replaced with undefined.
string
Format string containing {key} placeholders.
Record<string, unknown>
Object whose property values are substituted.
string
The formatted string.
format("Hello, {name}!", { name: "World" });
// "Hello, World!"
format("{a} + {b} = {c}", { a: 1, b: 2, c: 3 });
// "1 + 2 = 3"