Socket
Book a DemoInstallSign in
Socket

css-diff

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

css-diff

CSS Diff --------

latest
npmnpm
Version
0.4.1
Version published
Weekly downloads
101
77.19%
Maintainers
1
Weekly downloads
 
Created
Source

CSS Diff

Compare two CSS/STYLUS/SCSS files at a Parse Tree level. Useful when you are comparing the output of two versions of a library implemented in different preprocessor libraries. This tool makes it simple to see if the compiled output of a stylus file matches the compiled output of a scss file.

Using

Command Line

The command line interface takes 2 paths to css/styl/scss files as well as an options -v or --visual argument to print the diff. The return value of the invokation with be true or false.

  • $ npm install css-diff
  • $ node_modules/.bin/css-diff path/to/file.styl path/to/file2.css -v

In your code

  • $ npm install css-diff --save
require("css-diff")({
  files: [
    "path/to/file1.css",
    "path/to/file2.scss"
  ],
  omit: [ //optional ability to omit rule types
    "comment"
  ]
  visual: true //defaults to false
}).then(function(diff) {
  console.log(diff.visual);
  console.log(diff.different);
})

FAQs

Package last updated on 13 Feb 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts