Socket
Socket
Sign inDemoInstall

md5-file

Package Overview
Dependencies
0
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    md5-file

return an md5sum of a given file


Version published
Maintainers
1
Install size
3.55 kB
Created

Readme

Source

md5-file Build Status

Simply return an md5 sum of a given file.

Installation

$ npm install md5-file

Test:

$ npm test

API

Sync:

md5File(path)

var md5File = require('md5-file');

md5File('path/to/a_file'); // '18e904aae79b5642ed7975c0a0074936'

Async:

md5File(path, callback, [strict])

If strict is true and there is an error it will throw it, otherwise it will pass an error string through the callback.

md5File.async('./README.md', function (data) {
  console.log(data);
});

md5File.async('./README.md', function (data) {
  console.log(data);
}, true);

// errors

// non-strict: will pass through an error to `data`
md5File.async('./null', function (data) {
  console.log(data);
});

// strict: will throw an error
md5File.async('./null', function (data) {
  console.log(data);
}, true);

License

MIT

Keywords

FAQs

Last updated on 06 Dec 2014

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc