https://github.com/sapegin/smpltmpl
Simple templates for Node.js based on ECMAScript template literals syntax
https://github.com/sapegin/smpltmpl
template template-engine
Last synced: 10 months ago
JSON representation
Simple templates for Node.js based on ECMAScript template literals syntax
- Host: GitHub
- URL: https://github.com/sapegin/smpltmpl
- Owner: sapegin
- License: mit
- Created: 2017-11-13T21:39:42.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-01-09T09:15:34.000Z (about 3 years ago)
- Last Synced: 2024-10-12T13:43:09.294Z (about 1 year ago)
- Topics: template, template-engine
- Language: JavaScript
- Size: 259 KB
- Stars: 6
- Watchers: 3
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: Readme.md
- Contributing: Contributing.md
- License: License.md
Awesome Lists containing this project
README
# smpltmpl
[](https://travis-ci.org/sapegin/smpltmpl)
Simple templates for Node.js based on ECMAScript [template literals](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals) syntax.
## Installation
```bash
npm install --save smpltmpl
```
## Usage
Using a string:
```js
const { template } = require('smpltmpl');
console.log(template('Hello ${who}!', { who: 'templates' }));
```
Using a template file:
```js
const { templateFromFile } = require('smpltmpl');
console.log(templateFromFile('template.txt', { who: 'templates' }));
```
## Change log
The change log can be found on the [Releases page](https://github.com/sapegin/smpltmpl/releases).
## Contributing
Everyone is welcome to contribute. Please take a moment to review the [contributing guidelines](Contributing.md).
## Authors and license
[Artem Sapegin](http://sapegin.me) and [contributors](https://github.com/sapegin/smpltmpl/graphs/contributors).
MIT License, see the included [License.md](License.md) file.