Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/patricklx/ember-template-tag


https://github.com/patricklx/ember-template-tag

Last synced: 1 day ago
JSON representation

Awesome Lists containing this project

README

        

# ember-template-tag

instead of using ember-template-imports to find, parse & transform templates, this can be used.

```js
const { parseTemplates, preprocessEmbeddedTemplates, transform } = require('ember-template-tag');
const { TEMPLATE_TAG_NAME, TEMPLATE_LITERAL_IDENTIFIER, TEMPLATE_LITERAL_MODULE_SPECIFIER } = require('ember-template-tag');
```

the output of parseTemplates is
```html
Hello!
```

```js
[
{
"contentRange": [
10,
16,
],
"contents": "Hello!",
"endRange": {
"end": 27,
"start": 16,
},
"range": [
0,
27,
],
"startRange": {
"end": 10,
"start": 0,
},
"tagName": "template",
"type": "template-tag",
},
]
```

## to transform

```js
const { transform } = require('ember-template-tag');
const transformed = transform('...')
```