Skip to content

Repository files navigation

Build StatusTotal downloads

NPM

parse-diff

Simple unified diff parser for JavaScript

JavaScript Usage Example

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

About

Unified diff parser for nodejs and browser

Resources

Stars

99 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages