{"repo":"vitaly-t/custom-string-formatter","free":true,"listed":false,"github":"https://github.com/vitaly-t/custom-string-formatter","clone":"git clone https://github.com/vitaly-t/custom-string-formatter.git","description":"Customizable String Formatter","language":"TypeScript","stars":17,"topics":["formatting","string","template","variable"],"license":"MIT","category":"dev-tools","readme_excerpt":"custom-string-formatter Installation Variable Syntax Formatting Filters - Filter Arguments Self-Reference Input Analysis Safety Checks Performance Replaces variables in a string, using your own value formatting. The variable syntax supports: nested properties filters chaining / pipeline filter arguments ${prop1.prop2.prop3 filter1 filter2 filter3 : arg1 : arg2} Basic Use: And because the above is based on interfaces, you can simplify it to just: Installation Current GitHub CI is set up for just NodeJS v18-v24, but it works in all browsers the same. Variable Syntax Basic variable syntax is as below: ${propertyName} $(propertyName) $ The extra syntax is for cases like combining it with ES6 Template Literals, etc. Property names follow a simple JavaScript variable notation: the name can contain letters (case-sensitive), digits, $ , (underscore) and . for nested properties. For array access, like prop[123].value , use prop.123.value syntax instead, for the fastest possible value resolution that avoids performance-expensive property tokenization. You can use a combination of the above inside one string, but you cannot combine opener-closer pairs, i.e. something like ${propertyName) is invalid, and won't be recognized as a variable. Full Syntax: Full variable syntax supports a chain of nested properties, plus optional filters with arguments: ${prop1.prop2.prop3 filter1 filter2 filter3 : arg1 : arg2} . All spaces in between are ignored, i.e. ${ prop filter : arg } works the same as ","default_branch":null,"files":null,"tree":[],"storefront":"/r/vitaly-t","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/vitaly-t/custom-string-formatter/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}