# files-hash

> Hash a glob of files

Latest version **1.0.2** (published 2015-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install files-hash
pnpm add files-hash
yarn add files-hash
bun add files-hash
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2015-08-23 |
| First published | 2015-08-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | David Padbury |
| Maintainers | davidpadbury |
| Keywords | hash, cache, files |

## Links

- npm: https://www.npmjs.com/package/files-hash
- npm.io page: https://npm.io/package/files-hash

## Dependencies (4)

- [glob](https://npm.io/package/glob.md) ^5.0.14
- [throat](https://npm.io/package/throat.md) ^2.0.2
- [babel-runtime](https://npm.io/package/babel-runtime.md) ^5.8.20
- [es6-promisify](https://npm.io/package/es6-promisify.md) ^3.0.0

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2015-08-23
- 1.0.1 — 2015-08-22
- 1.0.0 — 2015-08-22

## README

# files-hash

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

## Installation

Install the package with npm.

```
npm install files-hash
```

## Usage

```javascript
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](https://www.npmjs.com/package/glob#glob-primer).
* **option**: Object passed to glob module. [Documentation of glob options](https://www.npmjs.com/package/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.

---
_Source: https://npm.io/package/files-hash · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
