Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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
  • Socket score

Version published
Maintainers
2
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

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