dom-clean

DOM Cleaner

Usage no npm install needed!

<script type="module">
  import domClean from 'https://cdn.skypack.dev/dom-clean';
</script>

README

Dom Clean

Simple dom utility to strip comments from a dom tree and removes empty blank spaces.

To ensure traversing will only meet ELEMENT_NODEs or TEXT_NODEs.

Usage:

var DomClean = require('dom-clean').clean;
var el = document.body;
DomClean(el);

If you want to keep the comments use:

DomClean(el, true);

Test:

testem