@robinblomberg/html-serializer
v0.3.5
Published
## Installation
Readme
HTML serializer
Installation
npm install @robinblomberg/html-serializerUsage
import { serialize } from '@robinblomberg/html-serializer';
serialize(
h.document([
h.doctype(),
h.html([
h.head([
h.meta({ charset: 'utf-8' }),
h.title('Hello world!'),
h.link({ rel: 'stylesheet', href: 'style.css' }),
]),
h.body([h.h1('Hello world!'), h.p('Welcome to my website.')]),
]),
]),
);
// '<!DOCTYPE html>' +
// '<html>' +
// ' <head>' +
// ' <meta charset="utf-8">' +
// ' <title>Hello world!</title>' +
// ' <link rel="stylesheet" href="style.css">' +
// ' </head>' +
// ' <body>' +
// ' <h1>Hello world!</h1>' +
// ' <p>Welcome to my website.</p>' +
// ' </body>' +
// '</html>'