Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hashdirectory

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

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

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
385
increased by26.64%
Maintainers
1
Weekly downloads
 
Created
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

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

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc