npm.io
0.0.4 • Published 2 years ago

@decentra/html-markup

Licence
MIT
Version
0.0.4
Deps
0
Size
11 kB
Vulns
0
Weekly
0

html-markup

Package to render markup based on Javascript template literals. It to some extent based on/inspired by work of Jason Miller at https://github.com/developit/htm

This is VERY simplistic implementation based on tagged templates.

The purpose is just perform the kind of SSR (server-side-rendering).

Usage:

import html from "@decentra/html-markup";

export function renderSomeHtml(values) {
    return html`<div class="${values.className}`>
        {values.items.map(item => html`<div>${item.message}</div>`)}
    </div>`;
}