pc__search_class_in_html

This is plugin for nmp-package "Post-Compression". He's searching for the names of classes in the HTML code.

Usage no npm install needed!

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

README

Search className in HTML

This is plugin for nmp-package "Post-Compression".
He's searching for the names of classes in the HTML code.

An example of using:

var searchClassNameInHTML = require("pc__search_class_in_html"),
    uniqueNames = {};

gulp.src("./*.html")
    .pipe(postCompression.search([
        searchClassNameInHTML()
    ], uniqueNames));    

Where:

  • uniqueNames - an object of type JSON with rules replace the long words to short words.

An example of HTML code:

<p class="someClassA"></p>
<p class="someClassA someClassB"></p>

An example of a result searching:

{
    "someClassA": 2,
    "someClassB": 1
}