Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stevenvachon/create-html-template-element
Create an HTML <template> with content.
https://github.com/stevenvachon/create-html-template-element
dom template
Last synced: about 2 months ago
JSON representation
Create an HTML <template> with content.
- Host: GitHub
- URL: https://github.com/stevenvachon/create-html-template-element
- Owner: stevenvachon
- License: mit
- Created: 2019-05-04T18:36:50.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-09T01:04:27.000Z (over 5 years ago)
- Last Synced: 2024-10-26T00:09:44.044Z (3 months ago)
- Topics: dom, template
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# create-html-template-element [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url]
> Create an HTML `` with content.
## Installation
[Node.js](http://nodejs.org/) `>= 10` is required. To install, type this at the command line:
```shell
npm install create-html-template-element
```## Importing
ES Module:
```js
import createHTMLTemplateElement from 'create-html-template-element';
```CommonJS Module:
```js
const createHTMLTemplateElement = require('create-html-template-element');
```## Usage
As a [tagged template literal](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#Tagged_templates) (notice the syntax highlighting):
```js
const html = createHTMLTemplateElement;const TEMPLATE = html`
txt
`;
//-> HTMLTemplateElement
```As a regular function:
```js
const TEMPLATE = createHTMLTemplateElement(`txt`);
//-> HTMLTemplateElement
```[npm-image]: https://img.shields.io/npm/v/create-html-template-element.svg
[npm-url]: https://npmjs.com/package/create-html-template-element
[travis-image]: https://img.shields.io/travis/stevenvachon/create-html-template-element.svg
[travis-url]: https://travis-ci.org/stevenvachon/create-html-template-element