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

files-hash

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

files-hash

Hash a glob of files

  • 1.0.2
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

files-hash

Hash a glob of files. Useful for caching and things.

Installation

Install the package with npm.

npm install files-hash

Usage

var hash = require('files-hash');

hash('**/*.txt', { cwd: 'test/example' })
    .then(function(hashes) {
        console.log(hashes);
    });

/**
 * Produces:
 * { 'hello1.txt': '75fdf620d8a1c7e6ea7f4c24ba5ff991fbb82e86',
   'hello2.txt': '38ffd0b05376325c933e89ff8f0c2ccf1de05a01' }
 **/

API

hash(glob, [options]) : Promise

  • glob: String glob pattern. Documentation of glob syntax.
  • option: Object passed to glob module. Documentation of glob options.

Returns a Promise which resolves with an object where each key is a path relative to the glob cwd. The SHA1 hash of that file is the value.

Keywords

FAQs

Package last updated on 23 Aug 2015

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