Skip to main content

Built and signed on GitHub Actions

Tiny html tag function for no-build JSX-like syntax, compatible with all modern browsers and runtimes.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
4 months ago (1.0.1)
/** * Interprets a template literal as an HTML template. * @param strings The string parts * @param values The values to interpolate * @returns The concatenated string parts with values interpolated */ export function html( strings: TemplateStringsArray, ...values: unknown[] ): string { return strings.reduce((acc, string, i) => { const value = values[i] if (Array.isArray(value)) return acc + string + value.join('') if (value != null && !!value !== value) return acc + string + value return acc + string }, '') }