folder-hash
Advanced tools
Comparing version 1.0.0 to 1.0.2
{ | ||
"name": "folder-hash", | ||
"version": "1.0.0", | ||
"version": "1.0.2", | ||
"description": "Create a hash checksum over a folder and its content - its children and their content", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -1,4 +0,4 @@ | ||
# folderHash | ||
# folderHash | ||
##Description | ||
## Description | ||
Create a hash checksum over a folder or a file. | ||
@@ -11,20 +11,21 @@ The hashes are propagated upwards, the hash that is returned for a folder is generated over all the hashes of its children. | ||
{ name: 'test', | ||
hash: 'qmUXLCsTQGOEF6p0w9V78MC7sJI=' | ||
hash: 'qmUXLCsTQGOEF6p0w9V78MC7sJI=', | ||
children: [ | ||
{ name: 'helper', | ||
hash: 'x1CX3yVH3UuLTw7zcSitSs/PbGE=' | ||
hash: 'x1CX3yVH3UuLTw7zcSitSs/PbGE=', | ||
children: [ | ||
{ name: 'helper.js', hash: 'pHYwd8k/oZV01oABTz9MC8KovkU=' } | ||
] } | ||
] }, | ||
{ name: 'test.js', hash: 'L/vqpdQhxmD5w62k24m4TuZJ1PM=' } | ||
] } | ||
] | ||
} | ||
Each file returns a name and a hash, and each folder returns additionally an array of children (file or folder elements). | ||
##Usage | ||
## Usage | ||
First, install the dependencies by executing `npm install`. | ||
###With promises | ||
### With promises | ||
var hasher = require('folderHash'); | ||
var hasher = require('folder-hash'); | ||
// pass element name and folder path separately | ||
@@ -41,5 +42,5 @@ hasher.hashElement('node_modules', __dirname).then(function (hash) { | ||
###With callbacks | ||
### With callbacks | ||
var hasher = require('folderHash'); | ||
var hasher = require('folder-hash'); | ||
// pass element name and folder path separately | ||
@@ -59,6 +60,6 @@ hasher.hashElement('node_modules', __dirname, function (error, hash)) { | ||
##Behavior | ||
## Behavior | ||
The behavior is documented and verified in the unit tests. Execute `npm test` or `mocha test`, and have a look at the _test_ subfolder. | ||
###Creating hashes over files | ||
### Creating hashes over files | ||
**The hashes are the same if:** | ||
@@ -75,3 +76,3 @@ | ||
###Creating hashes over folders | ||
### Creating hashes over folders | ||
Content means in this case a folders children - both the files and the subfolders with their children. | ||
@@ -90,3 +91,3 @@ | ||
##License | ||
## License | ||
MIT, see LICENSE.txt |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18107
88