htmlize

A xmldom extension providing some useful features, on html documents, like in the browser, under the MIT licence

Usage no npm install needed!

<script type="module">
  import htmlize from 'https://cdn.skypack.dev/htmlize';
</script>

README

htmlize

A xmldom extension providing some useful features, on html documents, like in the browser, under the MIT licence

Install

npm install htmlize

Requirements

Since the ES2015 Proxy isn't actually supported, this module requires to start your app with a --harmony_proxies flag

Usage

var htmlize,
    document;

htmlize = require('htmlize');

document = htmlize(`<!DOCTYPE html><html><body></body></html>`);

Document features

document.title
document.body
document.forms
document.images
document.querySelector('selector')
document.querySelectorAll('selector')

// extras 
document.clean()
document.minify()
document.beautify('\t')

Element features

element.dataset
element.classList
element.form
element.querySelector('selector')
element.querySelectorAll('selector')