Get a list of differences between package dependencies
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
.travis.yml
LICENSE
README.md
index.js
package.json
test.js

README.md

dep-diff Build Status devDependency Status

Get a list of differences between package dependencies

var depDiff = require("dep-diff")
  , ChangedDep = depDiff.ChangedDep
  , AddedDep = depDiff.AddedDep
  , RemovedDep = depDiff.RemovedDep

var diffs = depDiff(
  {
    "async": "~0.1.2",
    "config": "~0.4.32",
    "consolidate": "~0.9.1"
  },
  {
    "async": "~0.2.9",
    "config": "~0.4.32",
    "couchwatch": "~0.6.0"
  }
)

// diffs is an array of 3 items [ChangedDep, AddedDep, RemovedDep]. You use instanceof to determine the diff type.
//
// ChangedDep.name = async
// ChangedDep.version = ~0.2.9
// ChangedDep.previous = ~0.1.2
//
// AddedDep.name = couchwatch
// AddedDep.version = ~0.6.0
//
// RemovedDep.name = consolidate
// RemovedDep.previous = ~0.9.1