A lightweight JavaScript library for simple string variable replacement using double-brace syntax like {{ name }}. Supports positional and named arguments, nested property access, partial application for incomplete argument lists, and a length modifier for padding. Current stable version is 0.4.2. The library is intentionally minimal and not a full templating engine; it compiles template strings into reusable functions. Suitable for cases where you need straightforward string interpolation without dependencies.
npm install formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage with named and positional variables using the require import style.
Use only numeric indices if you need partial application.
Switch to a maintained templating library.
Avoid deeply nested paths; verify the resulting string.
Ensure all variables are provided; alternatively, wrap formatter to detect undefined values.
Use DOMPurify or escape user input before formatting.
Run 'npm install formatter' or 'npm install --save formatter'.
Use 'const formatter = require("formatter");' or 'import formatter from "formatter";'.Use proper dot notation in template, e.g., '... {{ nested.prop }} ...' and ensure nested is an object.Consider replacing with a maintained library like handlebars or mustache.
No dependency data recorded yet.