
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
string-object-formatter
Advanced tools
Inspired by python named formatter function, replace text inside a string based on object properties names and values.
In a CommonJS environment
const Formatter = require('string-object-formatter');
Using import
import Formatter from 'string-object-formatter';
const formatter = new Formatter();
const toFormat = 'My name is {firstName} {lastName}';
const formatted = formatter.format(toFormat, {
firstName: 'John',
lastName: 'Doe',
});
// formatted is 'My name is John Doe'
const formatter = new Formatter('{{', '}}');
const toFormat = 'My name is {{firstName}} {{lastName}}';
const formatted = formatter.format(toFormat, {
firstName: 'John',
lastName: 'Doe',
});
// formatted is 'My name is John Doe'
+ new default(startDelimiter?: string, endDelimiter?: string, silent: boolean): default
Creates an instance of Formatter.
memberof Formatter
| Name | Type | Default value |
|---|---|---|
startDelimiter | string | '{' |
endDelimiter | string | '}' |
silent | boolean | false |
Returns: default
• silent: boolean
• endDelimiter: string
• startDelimiter: string
▸ format(stringToFormat: string, formatItems: FormatObject): string
Formats string according to object
memberof Formatter
| Name | Type | Description |
|---|---|---|
stringToFormat | string | The string to format |
formatItems | FormatObject | Ex.: {'toReplace': 'replaced'} turns 'example_{toReplace}' to 'example_replaced' |
Returns: string
The replaced string
FAQs
Python inspired named template formatter for Javascript strings
The npm package string-object-formatter receives a total of 6 weekly downloads. As such, string-object-formatter popularity was classified as not popular.
We found that string-object-formatter demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.