1.0.3 • Published 3 years ago

template-render-lite v1.0.3

Weekly downloads
1
License
ISC
Repository
github
Last release
3 years ago

Template Render Lite

Build Status

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