Basic usage

Given a string, an object of data, and a format expression to search for, returns a string with all elements that matched the search replaced with their matching value from the data object.

import { template } from 'radash'

template('It is {{color}}', { color: 'blue' }) // => It is blue
template('It is <color>', { color: 'blue' }, /<(.+?)>/g) // => It is blue

Testing

This _.template function is 100% covered by tests. See them and contribute at GitHub.

Source

See the source for _.template on GitHub.