htmltag

0.7.0 • Public • Published

htmltag

An HTML-like template literal tag.

Install

npm install htmltag

API

html(callsite, ...values)

A template tag function that returns TemplateResult objects.

import { html } from 'htmltag';

const planet = 'Earth';
const templateResult = html`<div>Hello ${planet}</div>`;

console.log(templateResult);

Class: TemplateResult

TemplateResult objects contain both the static and dynamic parts of a template.

templateResult.template

A tree representing the result of parsing the template.

templateResult.values

An array of values supplied to the template literal instance.

Package Sidebar

Install

npm i htmltag

Weekly Downloads

3

Version

0.7.0

License

MIT

Unpacked Size

13.5 kB

Total Files

6

Last publish

Collaborators

  • zenparsing