# cache-key

> create stable cache keys from complex objects

Latest version **1.0.0** (published 2023-07-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install cache-key
pnpm add cache-key
yarn add cache-key
bun add cache-key
```

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2023-07-13 |
| First published | 2023-07-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=16 |
| Dependencies | 0 |
| Unpacked size | 6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Stephan Meijer |
| Maintainers | smeijer |
| Keywords | node, module, boilerplate |

## Links

- npm: https://www.npmjs.com/package/cache-key
- Repository: https://github.com/smeijer/cache-key
- Homepage: https://github.com/smeijer/cache-key#readme
- Issues: https://github.com/smeijer/cache-key/issues
- Funding: https://github.com/smeijer/cache-key?sponsor=1
- npm.io page: https://npm.io/package/cache-key

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.0.0 (latest) — 2023-07-13

## README

# cache-key

> create stable cache keys from complex objects

## Install

```sh
npm install cache-key
```

## Usage

Just pass an array of values to `hashCacheKey` and it will return a stable hash. The order of items in the array is untouched. The keys of objects are sorted alphabetically.

```js
import { hashCacheKey } from 'cache-key';

hashCacheKey(['users', { id: 1, name: 'person' }]);
//=> '["users",{"id":1,name:"person"}]'

hashCacheKey(['users', { name: 'person', id: 1 }]);
//=> '["users",{"id":1,name:"person"}]'
```

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