dombat
v1.2.2
Published
ultra-lightweight DOM builder
Downloads
6
Readme
dombat
Install
From NPM:npm install dombat
From GitHub:npm install xist/dombat
Example
import { html, head, title, body, div, p } from "dombat";
// import * as tag from "dombat"; <-- or you can do this
const dom = html(
head(title("Example DOM")),
body(div(p("This is an example paragraph inside a div.")))
);
The output of dom.getHTML()
would be:
<html>
<head>
<title>Example DOM</title>
</head>
<body>
<div>
<p>This is an example paragraph inside a div.</p>
</div>
</body>
</html>
Contribute
Pull requests are encouraged.