https://github.com/wolfchamane/amjs-templater
Running Handlebars, completes a template and returns its content in plain text
https://github.com/wolfchamane/amjs-templater
handlebars nodejs template
Last synced: 5 months ago
JSON representation
Running Handlebars, completes a template and returns its content in plain text
- Host: GitHub
- URL: https://github.com/wolfchamane/amjs-templater
- Owner: Wolfchamane
- License: mit
- Created: 2019-06-14T06:04:08.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:16:08.000Z (over 3 years ago)
- Last Synced: 2025-03-17T19:59:38.606Z (about 1 year ago)
- Topics: handlebars, nodejs, template
- Language: JavaScript
- Size: 642 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @amjs/templater 0.1.6

> Running Handlebars, completes a template and returns its content in plain text
## Installation
```bash
$ npm i @amjs/templater
```
## Usage
#### With Handlebars file
```handlebars
{{!-- HandlebarsFile.hbs --}}
Value is: {{value}}
```
```javascript
// 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
```javascript
// Using Handlebars file
const templater = require('@amjs/templater');
const template = 'Value is: {value}}';
console.log(templater(template, { value: 1000 }));
// Value is: 1000
```