This package used as a simple template engine that can replace values in a simple template text.
- Tiny library < 1kb
- simple to use
yarn add template-render-lite
or
npm install template-render-lite
import templateRender from "template-render-lite"
const inovice = {
name:"User",
year:2020,
price:15.99,
priceSymbol:"$"
}
const template = "Hello '{name}', total price = {price}{priceSymbol} || year {year}, {thisWillNotChange}"
console.log(templateRender(template,inovice))
Output
Hello 'User', total price = 15.99$ || year 2020, thisWillNotChange