You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

package-hash

Package Overview
Dependencies
Maintainers
2
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

package-hash

Generates a hash for an installed npm package, useful for salting caches

4.0.0
latest
Source
npm
Version published
Weekly downloads
5.8M
-14.29%
Maintainers
2
Weekly downloads
 
Created

What is package-hash?

The package-hash npm package is designed to generate a hash from the contents of a Node.js package. It computes a hash based on the actual contents of the package files, making it useful for tasks such as cache busting, integrity checks, or detecting changes in package contents.

What are package-hash's main functionalities?

Generate hash from package contents

This feature allows you to generate a hash string from the contents of a package located at a specified path. The function returns a promise that resolves with the hash.

const packageHash = require('package-hash');

packageHash('path/to/package').then(hash => {
  console.log('Package hash:', hash);
}).catch(err => {
  console.error('Error generating package hash:', err);
});

Other packages similar to package-hash

FAQs

Package last updated on 09 Apr 2019

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