hashdir
v0.0.1
Published
Hashes content in directory and returning object with file structure and hashes (useful in tests)
Downloads
13
Readme
hashdir
Hashes content in directory and returning object with file structure and hashes (useful in tests)
Install
Install with npm:
npm install --save hashdir
Example
var hashdir = require('hashdir');
/* `directory` structure:
directory/
folder/
file2.js
emptyfolder/
file1.js
*/
hashdir('directory', function (err, result) {
assert.deepEqual(result, {
'file1.js': 'SHA-1 of file1.js content',
'folder/file2.js': 'SHA-1 of file2.js content',
'folder/emptyfolder': undefined,
'folder/folder': undefined,
});
});
API
hashdir(path[, opts], cb)
path: path to directory, that you want to be hashed.
Options: Object, that passed to walk
module.
Callback: function, that recieves error
as first argument and result
object in second.
License
MIT © Vsevolod Strukchinsky