return an md5sum of a given file opened with graceful-fs
npm install md5-file-gracefulsh
npm install --save md5-file-graceful
`
Usage
$3
`js
const md5File = require('md5-file-graceful')
/ Async usage /
md5File('LICENSE.md', (err, hash) => {
if (err) throw err
console.log(The MD5 sum of LICENSE.md is: ${hash})
})
/ Sync usage /
const hash = md5File.sync('LICENSE.md')
console.log(The MD5 sum of LICENSE.md is: ${hash})
`
$3
`
$ md5-file-graceful LICENSE.md
`
Promise support
If you require md5-file-graceful/promise you'll receive an alternative API where all
functions that takes callbacks are replaced by Promise-returning functions.
`js
const md5File = require('md5-file-graceful/promise')
md5File('LICENSE.md').then(hash => {
console.log(The MD5 sum of LICENSE.md is: ${hash})
})
`
API
$3
Asynchronously get the MD5-sum of the file at filepath.
The callback cb will be called with (err: Error, hash: string).
$3
Synchronously get the MD5-sum of the file at filepath`.