template-render-lite
v1.0.3
Published
A simple library to render a template text with variables
Downloads
5
Maintainers
Readme
Template Render Lite
This package used as a simple template engine that can replace values in a simple template text.
Features
- Tiny library < 1kb
- simple to use
How to install
yarn add template-render-lite
or
npm install template-render-lite
Example
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