Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
This repository was archived by the owner on Feb 13, 2024. It is now read-only.

An binary diff and patch library based on bsdiff algorithm for NodeJS (Windows, Mac, Linux).

License

NotificationsYou must be signed in to change notification settings

gaetandezeiraud/bsdiff-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CINpmLicense

🔴Project status: discontinued

  • Project is no longer in development
  • Issues are not accepted
  • Pull requests are not accepted
  • Repository is archived

bsdiff-node

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.


Installation

Install as a dependency for your project (need python 3.x):

npm i bsdiff-node

Usage

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();

License

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


[8]ページ先頭

©2009-2025 Movatter.jp