1.0.4 • Published 7 years ago

filecompare v1.0.4

Weekly downloads
203
License
MIT
Repository
github
Last release
7 years ago

Build Status Project Git Url

filecompare

Asynchronous file compare. Now using native Promises and native BufferTools (alloc and Buffer comparisons)

install

npm install --save filecompare

test

npm test

Example

var fc = require('filecompare');
var cb = function(isEqual) {
  console.log("equal? :" + isEqual);
}
fc(path1,path1,cb);

command line usage

npm install -g filecompare

filecompare a.txt b.txt

Features

  • perfect for high stress systems
  • works with binary data
  • perfect for comparing very large files

Advanced usage

Specify read size and buffer size.

var fc = require('filecompare');
var cb = function(isEqual) {
  console.log("equal? :" + isEqual);
}
const readSize = 4096;
const bufferSize = 8192;
fc(path1,path1,cb,readSize, bufferSize);

Why is this useful?

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.

LICENSE

MIT

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.0.6

7 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

10 years ago

0.0.2

11 years ago

0.0.1

11 years ago