Socket
Socket
Sign inDemoInstall

difftool

Package Overview
Dependencies
4
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    difftool

Diff module to compare javascript objects and xml data


Version published
Weekly downloads
3
increased by50%
Maintainers
2
Install size
1.12 MB
Created
Weekly downloads
 

Readme

Source

#difftool

diff module to compare and diff JSON and XML

Build Status

NPM

Usage

$ npm install difftool --save
var difftool = require('difftool');
    
difftool.diff(lhs,rhs,schema, options, function(result) {

}

lhs and rhs are the two objects to compare.

schema - you can specify a schema to apply to the comparison to compare just by type or skip the field example:

var schema = { a: { skipKey:true, compareValues: true, compareTypes: true  }}

in this example when it gets to compare the a field, we tell the comparison to: skipKey: don't compare at all, exclude it from the report compareValues: if false we compare the types but not the values of the property compareType: if false we don't compare neither the values nor the types of a property

options is an object with 2 fields: options.filter(a,b) is a function you can pass to the comparison, it's yield every time 2 fields are compared, if the function return true the comparison for those fields is skipped. options.stringCaseInsensitive is a boolean, if true the string comparison is done case insensitive

result is an array returned from the diff method containing all the differences

Release history

  • v0.1.0 (2015-05-10)
  • added tested and improved docs
  • v0.0.1 (2015-05-09)
  • initial release

Contributors

Keywords

FAQs

Last updated on 10 May 2015

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc