Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including different with all npm packages installed. Try it out:

var different = require("different")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

different v0.2.2

A module for parsing git diffs


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'

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free