Socket
Book a DemoInstallSign in
Socket

hash-dir-contents

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hash-dir-contents

A simple function for computing the hash of the contents of an entire directory

0.0.2
latest
npmnpm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

hash-dir-contents

A simple function for computing the hash of the contents of an entire directory.

Build Status Coverage Status NPM version Dependency Status

NPM

Installation

npm install hash-dir-contents

Usage

This module exports a function that has the following signature:

function([options], callback)

where options is an object that can contain the following properties:

  • directory - (optional) The directory to hash the contents of. Defaults to the current working directory.
  • algorithm - (optional) The algorithm to use to hash the content, "sha1" or "md5". Defaults to "sha1".

and callback is a function that will be passed an error object as the first parameter and the hash as the second parameter.

Examples

var hasher = require('hash-dir-contents');

hasher({
	directory: '/home/me/stuff',
	algorithm: 'md5'
}, function(error, hash) {
	console.log(hash); // example: '843d5af0230cb6ddcd767e9d92f7e152'
});

Bitdeli Badge

Keywords

glob

FAQs

Package last updated on 31 Jan 2014

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.