1.0.2 • Published 2 years ago

render-templates v1.0.2

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

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: 'john.doe@example.com'
  }
};

const result = render(template, view);
console.log(result);
// Logged in as John Doe (john.doe@example.com).
1.0.2

2 years ago

1.0.0

2 years ago

0.0.0

2 years ago