Socket
Socket
Sign inDemoInstall

hashdirectory

Package Overview
Dependencies
1
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    hashdirectory

Create an sha1 hash sum from a directory of files using the git algorithm


Version published
Weekly downloads
1.3K
increased by78.95%
Maintainers
1
Install size
386 kB
Created
Weekly downloads
 

Readme

Source

hashdirectory

Create an sha1 hash sum from a directory of files using the git algorithm.

Build Status

Creating a hash for an entire directory, instead of for a single file, can be useful for cache busting. Using git's method of creating the hash just builds upon something consistent that is known to work.

This package does not requires git to be installed on the production server, however. It only reproduces the git algorithm for hashing files and folders (but not commits or tags).

Installation

npm install --save hashdirectory

Usage

var hashdirectory = require('hashdirectory');

// Synchronous, for before your webserver starts up.
var hashed = hashdirectory.sync('./public');

// Asynchronous, for everything else.
hashdirectory('./public', function(err, hashed) {
});

// Or, if promises are more your thing.
var hashedPromise = hashdirectory('./public');

Keywords

FAQs

Last updated on 30 Apr 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