cache-key

JSON →
library 1.0.0 ·javascript
verified Jun 7, 2026

cache-key is a lightweight library for creating stable, deterministic cache keys from complex JavaScript objects. Version 1.0.0 targets Node.js >=16, ships TypeScript definitions, and provides a single function `hashCacheKey` that returns a JSON-stringified representation, sorting object keys alphabetically for consistency. Unlike JSON.stringify or libraries like object-hash, cache-key focuses on simplicity: it does not hash into short strings but retains the structure as a string for readability. Ideal for memoization and simple caching scenarios where inputs are arrays of mixed values and keys must be order-aware but property-order-independent.