Get the MD5-sum of a given directory, with low memory usage, even on huge files.
npm install md5-dirGet the MD5-sum of a given directory, with low memory usage, even on huge files.
``sh`
npm install --save md5-dir
`js
const md5Dir = require('md5-dir')
/ Async usage /
md5Dir('Documents', (err, hash) => {
if (err) throw err
console.log(The MD5 sum of Documents is: ${hash})
})
/ Sync usage /
const hash = md5Dir.sync('Documents')
console.log(The MD5 sum of Documents is: ${hash})`
You can optionally exclude the callback argument to receive a promise:
`js
const md5Dir = require('md5-dir')
md5Dir('Documents').then(hash => {
console.log(The MD5 sum of Documents is: ${hash})`
})
Asynchronously get the MD5-sum of the directory at dirname.
The callback cb will be called with (err: Error, hash: string).
Synchronously get the MD5-sum of the directory at dirname.
#### ignore
File or list of files to ignore. Follows the same format as .gitignore-files. Uses the ignore` module.
MIT