mostly-html
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

Mostly HTML

Creates HTML from mostly-dom VNode

Get it

yarn add mostly-html mostly-dom
# or 
npm install --save mostly-html mostly-dom

API

toHtml(vNode: VNode): string

Given a VNode it returns a HTML string

import { div, button, h1 } from 'mostly-dom'
import { toHtml } from 'mostly-html'
 
const view = (amount: number) =>
  div({ className: 'foo' }, [
    button({ id: 'increment' }, 'Increment'),
    button({ id: 'decrement' }, 'Decrement'),
    h1(String(amount))
  ])
 
const html = toHtml(view(1))
 
console.log(html)
// => <div class="foo"><button id="increment">Increment</button><button id="decrement">Decrement</button><h1>1</h1></div>

Readme

Keywords

none

Package Sidebar

Install

npm i mostly-html

Weekly Downloads

0

Version

3.0.0

License

MIT

Unpacked Size

260 kB

Total Files

44

Last publish

Collaborators

  • tylors