Skip to content

Latest commit

 

History

History
31 lines (23 loc) · 518 Bytes

File metadata and controls

31 lines (23 loc) · 518 Bytes

VanJS Prerender

Author: binhtran432k

Prerender a VanJS tree to a static HTML string without using van-plate or minivan.

Install

npm install -D vanjs-prerender

Usage

import van from "vanjs-core";
import { prerender } from "vanjs-prerender";

const { a, div, li, p, ul } = van.tags

console.log(
  prerender(() => div(
    p("👋Hello"),
    ul(
      li("🗺️World"),
      li(a({href: "https://vanjs.org/"}, "🍦VanJS")),
    ),
  )),
);