Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

tempt

remarkablemark12MIT0.1.0

Simplified templating inspired by Mustache.

template, mustache, string, replace

readme

tempt

NPM

NPM version Build Status Coverage Status

Simplified templating inspired by Mustache:

tempt(template, data);

Note: Only the variable tag type is supported. For templating with greater features, check out:

Installation

NPM:

$ npm install tempt --save

Yarn:

$ yarn add tempt

Usage

Import the module:

var tempt = require('tempt');

Render template with data object:

tempt('Hello, {{name}}!', { name: 'world' });
// => 'Hello, world!'

Render template with data array:

tempt('Hello, {{0}}!', ['world']);
// => 'Hello, world!'

Testing

$ npm test
$ npm run lint:fix

Release

$ npm run release
$ git push --follow-tags

License

MIT