template-render-lite

1.0.3 • Public • Published

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

Package Sidebar

Install

npm i template-render-lite

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

1.84 kB

Total Files

3

Last publish

Collaborators

  • aguerram