Skip to content
different is a node module for parsing diffs from url or file
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


different is a node module for parsing git diff from a url or file into an array of JavaScript objects each representing changed files.


From NPM:

npm install different

From GitHub:

cd path/to/node_modules
git clone git://
cd different
npm install .


var different = require('different');

//parse diff from URL with options
different.parseDiff({url: ''}, function(diff) {console.log(diff)});

//parse diff from file with options
different.parseDiff({fileName: 'path/to/diff.diff'}, function(diff) {console.log(diff)});

//parse diff straight from url
different.parseDiffFromUrl('', function(diff) {console.log(diff)});

//parse diff straight from file
different.parseDiff('path/to/diff.diff', function(diff) {console.log(diff)});

Example Array Output

[ {
     [ 'Installation',
       'From NPM:',
       'npm install different',
       'From GitHub:',
       'cd path/to/node_modules',
       'git clone git://',
       'cd different',
       'npm install .',
       '//diff from URL',
       '//diff from file',
       'different.parseDiff({fileName: \'path/to/diff.diff\'}, function(diff) {console.log(diff)});' ],
    deletions: [ 'How to use', '--------------' ],
    fileExtension: 'md',
    a: '',
    b: ''
    additions: [ '"version": "0.1.2",', '"main": "different.js",' ],
    deletions: [ '"version": "0.1.1",' ],
    fileExtension: 'json',
    a: 'package.json',
    b: 'package.json'

You can’t perform that action at this time.