A tool to find duplicate CSS styles
npm install css-analyzecss-analyze is a tool to find duplicate CSS styles in order to simplify stylesheet optimizations.
WARNING: this project is heavily under development. The unit tests are being written, but right now it's barely tested (by hand), so use it at your own risk.
To install css-analyze globally:
``bash`
sudo npm i -g css-analyze
Or, alternatively, install it locally in a project to run it with npx:
`bash`
npm i -D css-analyze
To use css-analyze, simply run css-analyze (if you installed it globally) or npx css-analyze (if you installed it locally in a project).
Available commands:
- init - initializes a default configuration file: .css-analyze-rc.help
- - shows the help message.version
- - shows the version of the program.run
- - runs the analyzer against the specified glob in the configuration (src/*/.css by default). Alternatively, you can just execute css-analyze without any commands to run the analyzer.
- [ ] add command-line options that override the config
- [ ] write unit tests
- [ ] utilize asynchronous code - currently the analysis is taking ages to complete since it first processes all declarations and only then prints them
css-analyze is available under the MIT License. css-analyze` also uses external libraries that are available under a variety of licenses. See LICENSE for the full license text.