https://github.com/bartveneman/css-analyzer-diff
Calculate the difference between two sets of CSS stats
https://github.com/bartveneman/css-analyzer-diff
analyzer css css-analyzer-diff cssstats diff parker projectwallace stats stylestats wallace
Last synced: 4 months ago
JSON representation
Calculate the difference between two sets of CSS stats
- Host: GitHub
- URL: https://github.com/bartveneman/css-analyzer-diff
- Owner: bartveneman
- License: mit
- Created: 2018-07-23T20:11:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T15:16:02.000Z (about 3 years ago)
- Last Synced: 2025-06-14T13:49:30.431Z (8 months ago)
- Topics: analyzer, css, css-analyzer-diff, cssstats, diff, parker, projectwallace, stats, stylestats, wallace
- Language: JavaScript
- Size: 795 KB
- Stars: 13
- Watchers: 2
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# css-analyzer-diff
[](https://www.npmjs.com/package/css-analyzer-diff)
[](https://travis-ci.org/bartveneman/css-analyzer-diff)
[](https://snyk.io/test/github/bartveneman/css-analyzer-diff)


[](https://github.com/sindresorhus/xo)
[](https://www.projectwallace.com/oss)
Calculate the difference between two sets of [CSS stats](https://github.com/projectwallace/css-analyzer).
## Usage
```js
const differ = require("css-analyzer-diff");
const analyzeCss = require("@projectwallace/css-analyzer");
const [firstStats, secondStats] = await Promise.all([
analyzeCss(".cat { color: brown; }"),
analyzeCss(".cat { color: red; }")
]);
const changes = differ(firstStats, secondStats);
//=> Returns an object with all changes
// {
// 'values.colors.unique': [
// {
// value: 'brown',
// removed: true,
// added: false,
// changed: true
// },
// {
// value: 'red',
// removed: false,
// added: true,
// changed: true
// }
// ],
//
// ... many more ...
//
// }
```