
stringin
A teeny-weeny utility to programatically interpolate ES6 string templates.

Get Started
Install as a dependency in the console:
npm i stringin
Import and use in your JS/TS project:
import interpolate from 'stringin'
const template = 'There are ${choreCount} chores to do today'
interpolate(template, { choreCount: 4 })
interpolate(template, { choreCount: () => 2 + 5 })
Usage
replace (template, data)
Parameters:
template | string | The template string containing the different ${fieldNames} . |
data | Object | The data to insert into the template. |
Returns:
Type: String