Socket
Socket
Sign inDemoInstall

md5-dir

Package Overview
Dependencies
3
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

md5-dir


Version published
Maintainers
1
Created

Readme

Source

md5-dir js-standard-style

Get the MD5-sum of a given directory, with low memory usage, even on huge files.

Installation

npm install --save md5-dir

Usage

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}`)

Promise support

You can optionally exclude the callback argument to receive a promise:

const md5Dir = require('md5-dir')

md5Dir('Documents').then(hash => {
  console.log(`The MD5 sum of Documents is: ${hash}`)
})

API

md5Dir(dirname: string[, options: Options], cb?: function)

Asynchronously get the MD5-sum of the directory at dirname.

The callback cb will be called with (err: Error, hash: string).

md5Dir.sync(dirname: string[, options: Options]) => string

Synchronously get the MD5-sum of the directory at dirname.

Options

ignore

File or list of files to ignore. Follows the same format as .gitignore-files. Uses the ignore module.

License

MIT

FAQs

Last updated on 18 Oct 2021

Did you know?

Socket

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc