mirror of
https://github.com/arthur-pbty/portfolio2023.git
synced 2026-06-08 07:10:46 +02:00
42 lines
1.1 KiB
Markdown
42 lines
1.1 KiB
Markdown
# 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.
|