Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

recursive-sha256

1.0.1 • Public • Published

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

Install

npm i recursive-sha256

DownloadsWeekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • avatar