Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kodie/md5-file
return an md5sum of a given file
https://github.com/kodie/md5-file
checksum integrity md5sum verification
Last synced: about 2 months ago
JSON representation
return an md5sum of a given file
- Host: GitHub
- URL: https://github.com/kodie/md5-file
- Owner: kodie
- License: other
- Created: 2014-04-25T08:18:35.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-04-24T07:05:35.000Z (over 4 years ago)
- Last Synced: 2024-05-17T08:02:49.961Z (5 months ago)
- Topics: checksum, integrity, md5sum, verification
- Language: JavaScript
- Homepage: https://www.npmjs.org/package/md5-file
- Size: 59.6 KB
- Stars: 211
- Watchers: 5
- Forks: 20
- Open Issues: 2
-
Metadata Files:
- Readme: readme.md
- License: LICENSE.md
Awesome Lists containing this project
README
# MD5 file
Get the MD5-sum of a given file, with low memory usage, even on huge files.
## Installation
```sh
npm install --save md5-file
```## Usage
### As a module
```js
const md5File = require('md5-file')/* Async usage */
md5File('LICENSE.md').then((hash) => {
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}`)
```### As a command line tool
```sh
$ md5-file LICENSE.md
ad1faf9381e43c471dc381c17a4ee4b6
```## API
### `md5File(path: string) => Promise`
Asynchronously get the MD5-sum of the file at `path`.
Returns a [`Promise`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise) that will be resolved with a string containing the MD5-sum.
### `md5File.sync(path: string) => string`
Synchronously get the MD5-sum of the file at `path`.
### License
MIT