Socket
Socket
Sign inDemoInstall

folder-hash

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

folder-hash

Create a hash checksum over a folder and its content - its children and their content


Version published
Weekly downloads
177K
increased by0.4%
Maintainers
1
Weekly downloads
 
Created

What is folder-hash?

The folder-hash npm package is used to generate hash values for the contents of a folder. This can be useful for verifying the integrity of files, detecting changes, and ensuring consistency across different environments.

What are folder-hash's main functionalities?

Generate Hash for a Folder

This feature allows you to generate a hash for the contents of a specified folder. The hash can be used to verify the integrity of the folder's contents.

const folderHash = require('folder-hash');
const options = { folders: { include: ['*'] } };
folderHash.hashElement('path/to/folder', options)
  .then(hash => console.log(hash))
  .catch(error => console.error('Error:', error));

Customizing Hash Options

This feature allows you to customize the hashing options, such as the algorithm, encoding, and which files or folders to include or exclude.

const folderHash = require('folder-hash');
const options = { 
  algo: 'sha256', 
  encoding: 'hex', 
  folders: { exclude: ['node_modules', 'test'] }, 
  files: { include: ['*.js', '*.json'] } 
};
folderHash.hashElement('path/to/folder', options)
  .then(hash => console.log(hash))
  .catch(error => console.error('Error:', error));

Other packages similar to folder-hash

FAQs

Package last updated on 11 Jan 2023

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