UNPKG

lit-ntml

Version:

Inspired by lit-html but for Node.js

16 lines 729 B
import { parse, parseFragment, serialize, } from 'parse5'; import { parseLiterals } from './parse-literals.js'; import { parseLiteralsSync } from './parse-literals-sync.js'; const parser = parseLiterals(serialize); const parserSync = parseLiteralsSync(serialize); export const html = async (s, ...e) => parser((c) => parse(`<!doctype html>${c}`), s, ...e); export const htmlFragment = async (s, ...e) => parser(parseFragment, s, ...e); export const htmlSync = (s, ...e) => parserSync((c) => parse(`<!doctype html>${c}`), s, ...e); export const htmlFragmentSync = (s, ...e) => parserSync(parseFragment, s, ...e); export default { html, htmlFragment, htmlFragmentSync, htmlSync, }; //# sourceMappingURL=index.js.map