detect-unused-css

0.0.5 • Public • Published

detect-unused-css

A CLI for detect unused css from webPage or local directory.

detect-unused-css provides two utilities:

  • Webpage , fetch webpage and detect which style rule is unused.
  • Local , specify a directory css file , and use specify a directory to detect which style rule is unused.

Unsurprisingly, these two things will generate a report to help developer to remove unused style rule.

Usage

 npm install detect-unused-css -g
 
 # for webpage 
 detect-unused-css -p http://www.qq.com
 
 # for local directory  
 detect-unused-css -s /home/data/usr/js  -c /home/data/usr/css/main.css 
 

Options

  • -h, --help Show this help message and exit.
  • -v, --version Show program's version number and exit.
  • -s,--searchPath path for search
  • -c,--cssFile css for detect
  • -i, --include search include,eg: .js,ex/**/.js (default:.js,.tpl,*.html)
  • -p, --webpage detect unused css from web page,eg: http://www.qq.com/

if -p is set , other arguments will be ignored.

Readme

Keywords

none

Package Sidebar

Install

npm i detect-unused-css

Weekly Downloads

2

Version

0.0.5

License

MIT

Last publish

Collaborators

  • chriscai