- Notifications
You must be signed in to change notification settings - Fork31
An binary diff and patch library based on bsdiff algorithm for NodeJS (Windows, Mac, Linux).
License
gaetandezeiraud/bsdiff-node
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
🔴Project status: discontinued
- Project is no longer in development
- Issues are not accepted
- Pull requests are not accepted
- Repository is archived
An binary diff and patch library based on bsdiff algorithm for NodeJS (Windows, Mac, Linux)
If you find this package useful, please don't forget to star ⭐️ the repo, as this will help to promote the project.
Install as a dependency for your project (need python 3.x):
npm i bsdiff-node
constbsdiff=require('bsdiff-node');bsdiff.diff(oldFile,newFile,patchFile,function(result,err){});// Asyncbsdiff.patch(oldfile,newfile,patchfile,function(result,err){});// Asyncbsdiff.diffSync(oldFile,newFile,patchFile);// Syncbsdiff.patchSync(oldfile,newfile,patchfile);// Sync
For example:
constpath=require('path');constoldFile=path.join(__dirname,'resources/react-0.3-stable.zip');constnewFile=path.join(__dirname,'resources/react-0.4-stable.zip');constpatchFile=path.join(__dirname,'resources/react.patch');constgeneratedFile=path.join(__dirname,'resources/react-generated.zip');asyncfunctionasyncCall(){awaitbsdiff.diff(oldFile,newFile,patchFile,function(result){console.log('diff:'+String(result).padStart(4)+'%');});awaitbsdiff.patch(oldFile,generatedFile,patchFile,function(result){console.log('patch:'+String(result).padStart(4)+'%');});}asyncCall();
The original algorithm and implementation was developed by Colin Percival. Thealgorithm is detailed in his paper,Naïve Differences of Executable Code. For more information, visit hiswebsite athttp://www.daemonology.net/bsdiff/.
Copyright 2003-2005 Colin Percival
MIT © Dezeiraud
About
An binary diff and patch library based on bsdiff algorithm for NodeJS (Windows, Mac, Linux).