Download Latest Version 2026-05-27 source code.tar.gz (329.6 kB)
Email in envelope

Get an email when there's a new version of Cacheable

Home / 2026-05-27
Name Modified Size InfoDownloads / Week
Parent folder
2026-05-27 source code.tar.gz 2026-05-27 329.6 kB
2026-05-27 source code.zip 2026-05-27 408.5 kB
README.md 2026-05-27 7.4 kB
Totals: 3 Items   745.5 kB 0

Releasing 8 packages: @cacheable/memory@2.1.0 (minor), @cacheable/node-cache@3.1.0 (minor), cacheable@2.4.0 (minor), cache-manager@7.2.9 (patch), file-entry-cache@11.1.4 (patch), flat-cache@6.1.23 (patch), @cacheable/net@2.0.9 (patch), @cacheable/utils@2.4.2 (patch).

@cacheable/memory@2.1.0 — 2026-05-27

Add lifecycle hooks and maxTtl cap to CacheableMemory.

Features

  • add hooks for all cache operations via CacheableMemoryHooks enum (1ff149d, [#1644])

ts import { CacheableMemory, CacheableMemoryHooks } from '@cacheable/memory'; const cache = new CacheableMemory(); cache.onHookSync(CacheableMemoryHooks.BEFORE_SET, (data) => { data.value = transform(data.value); // mutate before write }); cache.set('key', 'value');

  • add maxTtl option to cap maximum time-to-live (948234a, [#1645])

ts const cache = new CacheableMemory({ ttl: '10m', maxTtl: '1h' }); cache.set('key', 'value', '2h'); // capped to 1h cache.set('key2', 'value2'); // no TTL → capped to 1h

Internal

  • migrate build from tsup to tsdown, pnpm 11 (1508695, [#1642])

Contributors

  • @jaredwray (3)

Full List of Changes

  • feat(cacheable, memory): add maxTtl option to cap maximum time-to-live by @jaredwray in [#1645]
  • feat(@cacheable/memory): add hooks like cacheable by @jaredwray in [#1644]
  • feat: Migrate to pnpm 11 with corepack and tsdown from tsup by @jaredwray in [#1642]

Full diff: https://github.com/jaredwray/cacheable/compare/9346f94...release/2026-05-27-8-packages


@cacheable/node-cache@3.1.0 — 2026-05-27

Add keys/has/getTtl/flushAll, events, useClones, checkperiod, and fix multiple stat-tracking bugs.

Features

  • add keys() and has() methods for cache inspection (bf3ea48, [#1643])

ts const store = new NodeCacheStore(); await store.set('a', 1); await store.keys(); // ['a'] await store.has('a'); // true

  • add getTtl() to inspect key expiration timestamps (bf3ea48, [#1643])

ts await store.set('key', 'val', 5000); const ttl = await store.getTtl('key'); // ms timestamp when key expires

  • add flushAll() to clear data and reset all stats (bf3ea48, [#1643])

ts await store.flushAll(); // clears data + resets stats, emits "flush"

  • add event emitters for set, del, expired, and flush operations (bf3ea48, [#1643])

ts store.on('set', (key, value, ttl) => { /* ... */ }); store.on('del', (key, value) => { /* ... */ }); store.on('expired', (key, value) => { /* ... */ }); store.on('flush', () => { /* ... */ });

  • add useClones option for deep-cloning via structuredClone (bf3ea48, [#1643])

ts const store = new NodeCacheStore({ useClones: true });

  • add checkperiod option for interval-based expired item detection (bf3ea48, [#1643])

ts const store = new NodeCacheStore({ checkperiod: 60 }); // check every 60s store.close(); // stop interval

  • add deleteOnExpire option and close()/getIntervalId() lifecycle methods (bf3ea48, [#1643])

Bug Fixes

  • fix setTtl() treating falsy cached values (0, "", false, null) as non-existent (bf3ea48, [#1643])
  • fix mdel() firing stats and events for non-existent keys (bf3ea48, [#1643])
  • fix startInterval() leaking old timer when called twice (bf3ea48, [#1643])
  • fix set() double-counting stats on key overwrites (bf3ea48, [#1643])
  • fix checkData() swallowing unhandled promise rejections (bf3ea48, [#1643])
  • fix handleExpired() stats underflow when Keyv auto-expires items (bf3ea48, [#1643])
  • fix checkData() mutating Map during iteration (bf3ea48, [#1643])

Internal

  • migrate build from tsup to tsdown, pnpm 11 (1508695, [#1642])
  • move store tests to use @faker-js/faker (d51b5f2, [#1641])

Contributors

  • @jaredwray (3)

Full List of Changes

  • feat(@cacheable/node-cache): enhance NodeCacheStore with missing features by @jaredwray in [#1643]
  • feat: Migrate to pnpm 11 with corepack and tsdown from tsup by @jaredwray in [#1642]
  • @cacheable/node-cache: move store tests to use @faker-js/faker by @jaredwray in [#1641]

Full diff: https://github.com/jaredwray/cacheable/compare/9346f94...release/2026-05-27-8-packages


cacheable@2.4.0 — 2026-05-27

Add maxTtl option to enforce an upper bound on cache entry lifetimes.

Features

  • add maxTtl option to cap maximum time-to-live on set() and setMany() (948234a, [#1645])

ts import { Cacheable } from 'cacheable'; const cache = new Cacheable({ ttl: '10m', maxTtl: '1h' }); await cache.set('key', 'value', '2h'); // capped to 1h await cache.set('key2', 'value2'); // no TTL → capped to 1h

Internal

  • migrate build from tsup to tsdown, pnpm 11 (1508695, [#1642])

Contributors

  • @jaredwray (2)

Full List of Changes

  • feat(cacheable, memory): add maxTtl option to cap maximum time-to-live by @jaredwray in [#1645]
  • feat: Migrate to pnpm 11 with corepack and tsdown from tsup by @jaredwray in [#1642]

Full diff: https://github.com/jaredwray/cacheable/compare/9346f94...release/2026-05-27-8-packages


cache-manager@7.2.9 — 2026-05-27

Build tooling migration to tsdown and pnpm 11.

Internal

  • migrate build from tsup to tsdown, pnpm 11 (1508695, [#1642])

Contributors

  • @jaredwray (1)

Full List of Changes

  • feat: Migrate to pnpm 11 with corepack and tsdown from tsup by @jaredwray in [#1642]

Full diff: https://github.com/jaredwray/cacheable/compare/9346f94...release/2026-05-27-8-packages


file-entry-cache@11.1.4 — 2026-05-27

Build tooling migration to tsdown and pnpm 11.

Internal

  • migrate build from tsup to tsdown, pnpm 11 (1508695, [#1642])

Contributors

  • @jaredwray (1)

Full List of Changes

  • feat: Migrate to pnpm 11 with corepack and tsdown from tsup by @jaredwray in [#1642]

Full diff: https://github.com/jaredwray/cacheable/compare/9346f94...release/2026-05-27-8-packages


flat-cache@6.1.23 — 2026-05-27

Build tooling migration to tsdown and pnpm 11.

Internal

  • migrate build from tsup to tsdown, pnpm 11 (1508695, [#1642])

Contributors

  • @jaredwray (1)

Full List of Changes

  • feat: Migrate to pnpm 11 with corepack and tsdown from tsup by @jaredwray in [#1642]

Full diff: https://github.com/jaredwray/cacheable/compare/9346f94...release/2026-05-27-8-packages


@cacheable/net@2.0.9 — 2026-05-27

Build tooling migration to tsdown and pnpm 11.

Internal

  • migrate build from tsup to tsdown, pnpm 11 (1508695, [#1642])

Contributors

  • @jaredwray (1)

Full List of Changes

  • feat: Migrate to pnpm 11 with corepack and tsdown from tsup by @jaredwray in [#1642]

Full diff: https://github.com/jaredwray/cacheable/compare/9346f94...release/2026-05-27-8-packages


@cacheable/utils@2.4.2 — 2026-05-27

Build tooling migration to tsdown and pnpm 11.

Internal

  • migrate build from tsup to tsdown, pnpm 11 (1508695, [#1642])

Contributors

  • @jaredwray (1)

Full List of Changes

  • feat: Migrate to pnpm 11 with corepack and tsdown from tsup by @jaredwray in [#1642]

Full diff: https://github.com/jaredwray/cacheable/compare/9346f94...release/2026-05-27-8-packages

Source: README.md, updated 2026-05-27