@amjs/templater

0.1.7 • Public • Published

@amjs/templater 0.1.6

version

Running Handlebars, completes a template and returns its content in plain text

Installation

$ npm i @amjs/templater

Usage

With Handlebars file

{{!-- HandlebarsFile.hbs --}}
Value is: {{value}}
// Using Handlebars file
const path = require('path');
const templater = require('@amjs/templater');
const hbsFile = path.resolve('HandlebarsFile.hbs');

console.log(templater(hbsFile, { value: 1000 }));
// Value is: 1000

With Handlebars-like plain text template

// Using Handlebars file
const templater = require('@amjs/templater');
const template = 'Value is: {value}}';

console.log(templater(template, { value: 1000 }));
// Value is: 1000

Package Sidebar

Install

npm i @amjs/templater

Weekly Downloads

1

Version

0.1.7

License

MIT

Unpacked Size

4.44 kB

Total Files

5

Last publish

Collaborators

  • amjs