1.0.1 • Published 7 years ago

recursive-sha256 v1.0.1

Weekly downloads
1
License
ISC
Repository
-
Last release
7 years ago

recursive-sha256 1.0.1

Provide the capability to recurse through a directory structure and either return checksums of all contents
or tell you which specific files have changed since last time.
 
State is maintained in a local sqlite3 database


Usage:

	var recursiveSHA256 = require('recursive-sha256').rsha256;
	var changed_files   = require('recursive-sha256').changed_files;
	var totalhash       = require('recursive-sha256').totalhash; 

	//
	// Get the SHA256 of a single file
	recursiveSHA256('./index.js', function (err, res) {
		console.log('Testing a single file...');
		console.log(res);
	});

	//
	// Get the SHA256 of everything in a folder
	recursiveSHA256('./tests', function (err, res) {
		console.log('Testing a folder...');
		console.log(res);
	});

	//
	// Return the SHA256 of all the hashes of all files in a folder ( a single hash code for everything is returned ) 
	totalhash('./', function (err, res) {
		console.log('getting total hash for ./');
		console.log(JSON.stringify(res, null, 2));
	});

	//
	// Return a list of files that have changed since the last run
	changed_files('./', function (err, res) {
		console.log('getting files that have changed under ./');
		console.log(JSON.stringify(res, null, 2));
	});

LOG:
~~~~~~~~~~~~~~~
	1.0.1 - Tried to fix the documentation formatting
	1.0.0 - initial release 


Shameless plug
~~~~~~~~~~~~~~~
https://allthethin.gs