@amjs/templater
v0.1.7
Published
Running Handlebars, completes a template and returns its content in plain text
Downloads
11
Readme
@amjs/templater 0.1.6
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