1.0.2 • Published 4 months ago

render-templates v1.0.2

Weekly downloads
-
License
-
Repository
-
Last release
4 months 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

4 months ago

1.0.0

4 months ago

0.0.0

4 months ago