Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@ungap/create-content

ungap42.2kISC0.3.1TypeScript support: definitely-typed

A cross browser utility to create HTML or SVG runtime content

HTMLTemplateElement, createContent, dom, utility, ungap

readme

createContent

Build Status Coverage Status Greenkeeper badge WebReflection status

A cross browser utility to create HTML or SVG runtime content, as lightweight alternative to what a HTMLTemplateElement polyfill could do through its content accessor.

Example

// createContent(markup[, type = 'html'[, normalize = false]])
const htmlContent = createContent('<td>any content</td>');
const svgContent = createContent('<rect x=1 y=2 />', 'svg');

Live test