You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

create-html-template-element

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

create-html-template-element

Create an HTML <template> with content.

1.0.0
latest
Source
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

create-html-template-element NPM Version Build Status

Create an HTML <template> with content.

Installation

Node.js >= 10 is required. To install, type this at the command line:

npm install create-html-template-element

Importing

ES Module:

import html from 'create-html-template-element';

CommonJS Module:

const html = require('create-html-template-element');

Usage

As a tagged template literal:

const TEMPLATE = html`
  <elm attr="val">txt</elm>
`;
//-> HTMLTemplateElement

As a regular function:

const TEMPLATE = html(`
  <elm attr="val">txt</elm>
`);
//-> HTMLTemplateElement

With custom document (useful for jsdom):

const TEMPLATE = html(`<elm attr="val">txt</elm>`, iframe.contentWindow.document);
//-> HTMLTemplateElement

Keywords

html

FAQs

Package last updated on 05 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts