Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/patricklx/ember-template-tag
https://github.com/patricklx/ember-template-tag
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/patricklx/ember-template-tag
- Owner: patricklx
- Created: 2023-07-21T08:23:34.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-26T08:27:49.000Z (6 months ago)
- Last Synced: 2024-10-09T12:45:24.915Z (3 months ago)
- Language: TypeScript
- Size: 395 KB
- Stars: 1
- Watchers: 2
- Forks: 3
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
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('...')
```