# useless-css-checker

> Unused CSS Checker. Built off of PurifyCSS

Latest version **0.2.0** (published 2020-01-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install useless-css-checker
pnpm add useless-css-checker
yarn add useless-css-checker
bun add useless-css-checker
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.0 |
| Published | 2020-01-27 |
| First published | 2018-04-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 277.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | ssulivan11 |

## Links

- npm: https://www.npmjs.com/package/useless-css-checker
- Repository: https://github.com/ssulivan11/useless-css-checker
- Homepage: https://github.com/ssulivan11/useless-css-checker#readme
- Issues: https://github.com/ssulivan11/useless-css-checker/issues
- npm.io page: https://npm.io/package/useless-css-checker

## Dependencies (7)

- [glob](https://npm.io/package/glob.md) ^7.1.1
- [yargs](https://npm.io/package/yargs.md) ^15.1.0
- [colors](https://npm.io/package/colors.md) ^1.2.1
- [rework](https://npm.io/package/rework.md) ^1.0.1
- [clean-css](https://npm.io/package/clean-css.md) ^4.0.12
- [node-emoji](https://npm.io/package/node-emoji.md) ^1.8.1
- [uglify-js-webpack-build](https://npm.io/package/uglify-js-webpack-build.md) ^3.3.22

## Recent versions

- 0.2.0 (latest) — 2020-01-27
- 0.1.9 — 2018-04-20
- 0.1.8 — 2018-04-20
- 0.1.7 — 2018-04-18
- 0.1.6 — 2018-04-18
- 0.1.5 — 2018-04-18
- 0.1.2 — 2018-04-18
- 0.1.1 — 2018-04-18
- 0.1.0 — 2018-04-18

## README

# Useless CSS Checker

A function that takes content (HTML/JS/etc) and CSS, and returns the validity of your unused selectors.

## Installation  

```bash
yarn add useless-css-checker -D
```
## Usage

```javascript
const uselessCssChecker = require('useless-css-checker')

module.exports.csscheck = () => {
  const content = [
    'dist/lib/main.js',
    'dist/lib/vendor.js'
  ];
  const css = [
    'dist/lib/main.css',
    'dist/lib/vendor.css'
  ];
  const options = {
    rejected: true,
    validationOutput: true, // gives output on rejections
    validationProcessExit: true, // determines if process.exit
    whitelist: ['*white-list-testing*']
  }
  uselessCssChecker(content, css, options)
}
```

### Success:
![Imgur](https://i.imgur.com/kk1Bcnt.png)

### Failure:
![Imgur](https://i.imgur.com/3SmtJQF.png)

---
_Source: https://npm.io/package/useless-css-checker · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
