sergeyt/parse-diff

Unified diff parser for nodejs and browser

JavaScript

99

195 commits

updated Jun 13, 2026

See the code

README

Build Status Total downloads

NPM

parse-diff

Simple unified diff parser for JavaScript

JavaScript Usage Example

var parse = require('parse-diff');
var diff = ''; // input diff string
var files = parse(diff);
console.log(files.length); // number of patched files
files.forEach(function(file) {
	console.log(file.chunks.length); // number of hunks
	console.log(file.chunks[0].changes.length) // hunk added/deleted/context lines
	// each item in changes is a string
	console.log(file.deletions); // number of deletions in the patch
	console.log(file.additions); // number of additions in the patch
});

sergeyt/parse-diff

Unified diff parser for nodejs and browser

JavaScript

99

195 commits

updated Jun 13, 2026

See the code

README

Build Status Total downloads

NPM

parse-diff

Simple unified diff parser for JavaScript

JavaScript Usage Example

var parse = require('parse-diff');
var diff = ''; // input diff string
var files = parse(diff);
console.log(files.length); // number of patched files
files.forEach(function(file) {
	console.log(file.chunks.length); // number of hunks
	console.log(file.chunks[0].changes.length) // hunk added/deleted/context lines
	// each item in changes is a string
	console.log(file.deletions); // number of deletions in the patch
	console.log(file.additions); // number of additions in the patch
});

Project health

Overall

3.3/10

Maintained

0/10

Code review

1/10
OpenSSF Scorecard

Latest release

0.12.0 · Apr 17, 2026

Releases this year

1

Significant stargazers

Andrew Powell

430 followers · starred Aug 2014

yujonglee

194 followers · starred Dec 2025

Stefan Buck

293 followers · starred Jun 2018