Installation
sh
npm install string-interpolation-parsersh
yarn add string-interpolation-parsersh
pnpm add string-interpolation-parserThe package ships dual builds and bundled type declarations, so it works in both module systems with no extra @types package.
ESM
ts
import parser from 'string-interpolation-parser';
// or the named export
import { parser } from 'string-interpolation-parser';CommonJS
require returns the function directly, preserving the v1 behaviour:
js
const parser = require('string-interpolation-parser');TypeScript
The public types are exported for convenience:
ts
import type { Context, Params, ParsedResult } from 'string-interpolation-parser';