Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: about 2 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 (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T04:16:08.000Z (about 2 years ago)
- Last Synced: 2024-11-28T00:06:35.836Z (about 2 months ago)
- Topics: handlebars, nodejs, template
- Language: JavaScript
- Size: 642 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# @amjs/templater 0.1.6
![version](https://img.shields.io/npm/v/@amjs/templater?style=flat-square)
> 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
```