Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 days 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 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-03T15:16:02.000Z (almost 2 years ago)
- Last Synced: 2024-05-01T14:09:05.411Z (6 months ago)
- Topics: analyzer, css, css-analyzer-diff, cssstats, diff, parker, projectwallace, stats, stylestats, wallace
- Language: JavaScript
- Size: 795 KB
- Stars: 13
- Watchers: 3
- Forks: 1
- Open Issues: 10
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# css-analyzer-diff
[![NPM Version](https://img.shields.io/npm/v/css-analyzer-diff.svg)](https://www.npmjs.com/package/css-analyzer-diff)
[![Build Status](https://travis-ci.org/bartveneman/css-analyzer-diff.svg?branch=master)](https://travis-ci.org/bartveneman/css-analyzer-diff)
[![Known Vulnerabilities](https://snyk.io/test/github/bartveneman/css-analyzer-diff/badge.svg)](https://snyk.io/test/github/bartveneman/css-analyzer-diff)
![Dependencies Status](https://img.shields.io/david/bartveneman/css-analyzer-diff.svg)
![Dependencies Status](https://img.shields.io/david/dev/bartveneman/css-analyzer-diff.svg)
[![XO code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![Project: Wallace](https://img.shields.io/badge/Project-Wallace-29c87d.svg)](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 ...
//
// }
```