Skip to content
Calculates symmetric difference between CSS and template classes.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
test
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json

README.md

symdiff

Build Status Coverage Status

Calculates symmetric difference between two arrays of strings. Main purpose is to detect unused CSS classes.

API

symdiff takes three arrays of strings as arguments:

  1. the classes used in CSS
  2. the classes used in templates
  3. classes to ignore

It outputs an object with the fields css and templates. For instance:

var css = ["grid", "grid-col", "grid-row"],
    html= ["grid"                        ],
    ignr= [        "grid-col"            ];

symdiff(css, html, ignr)
> { css: ["grid-row"], templates: [] }

License

Apache 2

You can’t perform that action at this time.