An open API service indexing awesome lists of open source software.

https://github.com/seregpie/tag

Parses a template literal to a function.
https://github.com/seregpie/tag

Last synced: about 2 months ago
JSON representation

Parses a template literal to a function.

Awesome Lists containing this project

README

        

# tag

Parses a template literal to a function.

## setup

### npm

```shell
npm i @seregpie/tag
```

---

Import inside an ES module.

```javascript
import tag from '@seregpie/tag';
```

*or*

Import inside a CommonJS module.

```javascript
let tag = require('@seregpie/tag');
```

### browser

```html

```

The function is globally available as `tag`.

## usage

```javascript
let renderTemplate = tag`Hi, ${'name'}!`;
let string = renderTemplate({name: 'Patrik'});
// => 'Hi, Patrik!'
```