cacheables

A simple in-memory cache written in Typescript with automatic cache invalidation and an elegant syntax.

MIT License

Downloads
5.1K
Stars
235
Committers
2
cacheables - v2.0.0 Latest Release

Published by grischaerbe 5 months ago

What's Changed

  • Fix: handle promise rejection and clear pending promise by @hodlen in https://github.com/grischaerbe/cacheables/pull/8.
  • Hybrid module: ESM and CommonJS – as moving from a pure CommonJS to a hybrid-distributed library does not come without upgrading headaches, I consider this a breaking change.

New Contributors

Full Changelog: https://github.com/grischaerbe/cacheables/compare/v1.2.2...v2.0.0

cacheables - v1.2.2

Published by grischaerbe almost 3 years ago

Features πŸŽ‰

  • Adds an option maxAge to the cache policy stale-while-revalidate to treat a cache as fresh for a certain amount of time and update in the background is maxAge is reached.
cacheables - v1.1.2

Published by grischaerbe about 3 years ago

README

  • No e-notation in large numbers in README and JSDocs
cacheables - v1.1.1

Published by grischaerbe about 3 years ago

  • Modified the README to not include top-level await.
  • Added size-limit to devDeps

Full Changelog: https://github.com/grischaerbe/cacheables/compare/v1.1.0...v1.1.1

cacheables - v1.1.0

Published by grischaerbe about 3 years ago

Features πŸŽ‰

  • Support for different cache policies – the former approach was implicitly cache-only or max-age.

Under the hood

  • Major refactoring.
  • More tests.

Breaking changes πŸ™€

  • As the cache policies are a new feature the API slightly changed.
  • As the concept of misses became unstable and hard to maintain with different cache policies, I dismissed it. Please update your application if it's is depending on the logs of misses. (hits are still a thing…). It might get a new chance at some point though.
cacheables - v0.3.2

Published by grischaerbe over 3 years ago

Misc

  • README: Better example (same as quickstart)
cacheables - v0.3.1

Published by grischaerbe over 3 years ago

Misc

  • Added a codesandbox.io quickstart to the README
cacheables - v0.3.0

Published by grischaerbe over 3 years ago

Features

  • cache.isCached(key) returns whether a cacheable is present and valid (i.e., did not time out)
  • No more setTimeout, therefore less memory leak potential, no cleanup necessary
  • Tests now also include timing edge cases
cacheables - v0.2.2

Published by grischaerbe over 3 years ago

  • Build shielt
cacheables - v0.2.1

Published by grischaerbe over 3 years ago

  • Auto publish to npm
cacheables - v0.2.0

Published by grischaerbe over 3 years ago

  • added tests
  • refactored (#1)
cacheables - v0.1.3

Published by grischaerbe over 3 years ago

Fixes

  • README
cacheables - v0.1.2

Published by grischaerbe over 3 years ago

Fixes

  • README
cacheables - v0.1.1

Published by grischaerbe over 3 years ago

Fixes

  • Readme
cacheables - v0.1.0

Published by grischaerbe over 3 years ago

Initial Release