package
asynchronous file compare
npm install filecompareGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
Estimated unpacked size across 2 packages.
53.2 kB
Includes dependencies.
Asynchronous file compare. Now using native Promises and native BufferTools (alloc and Buffer comparisons)
npm install --save filecomparenpm testvar fc = require('filecompare');
var cb = function(isEqual) {
console.log("equal? :" + isEqual);
}
fc(path1,path1,cb);npm install -g filecompare
filecompare a.txt b.txt
var fc = require('filecompare');
var cb = function(isEqual) {
console.log("equal? :" + isEqual);
}
const readSize = 4096;
const bufferSize = 8192;
fc(path1,path1,cb,readSize, bufferSize);Bytes are read into a small buffer, then compared.
Each step is independently asynchronous yet only steps forward after confirming buffers are identical.
This means if there is an unforseen process spike from some other processes, the file compare will exscuse itself until CPU load becomes more available. This means you can compare arbitrarily sized multi-gigabyte files all the time without worry about locking up the computer.
MIT