render-templates
v1.0.2
Published
Zero-dependency string template rendering.
Downloads
9
Maintainers
Readme
render-templates
Zero-dependency string template rendering.
Installation
npm install render-templates
# or
yarn add render-templates
# or
pnpm add render-templates
Example
import { render } from 'render-templates';
const template = 'Logged in as {{user.name}} ({{user.email}}).';
const view = {
user: {
name: 'John Doe',
email: '[email protected]'
}
};
const result = render(template, view);
console.log(result);
// Logged in as John Doe ([email protected]).