transitory

In-memory cache with high hit rates via LFU eviction for Node and browsers. Supports time-based expiration, automatic loading and metrics.

MIT License

Downloads
2.3K
Stars
34
Committers
3

Bot releases are visible (Hide)

transitory - 2.2.0 Latest Release

Published by aholstenson about 2 years ago

  • Fix: Race-condition in LoadingCache.get
  • Docs: Improved documentation of classes and interfaces
  • Chore: Minor source tweaks due to switch to ESLint
transitory -

Published by aholstenson over 5 years ago

  • Cache implementations are now exported to allow for direct use. Skipping the use of the builder allows for tree-shaking in ES Module projects
transitory -

Published by aholstenson over 5 years ago

Bugfix release to fix NPM deployment not including the built JavaScript files.

transitory -

Published by aholstenson over 5 years ago

Transitory has been rewritten in TypeScript allowing for a safer cache implementation and easier use in other TypeScript projects.

API changes in 2.x:

  • Cache can no longer be used with instanceof, it has been replaced with AbstractCache
  • get(key) has been replaced with getIfPresent(key) for all non-loading caches
  • RemovalCause has been renamed to RemovalReason and now uses strings instead of symbols
  • Builders are now created via newCache() instead of directly via the imported object

Other changes:

  • Separate CommonJS build for Node
  • ES Module builds to support tree-shaking and easier importing in browser projects
transitory -

Published by aholstenson over 6 years ago

  • Fix: memoryEstimator now works correctly with timed and bounded caches
transitory -

Published by aholstenson almost 7 years ago

  • Added support for peek(key) to allow peeking into the contents of a cache without loading or or affecting any metrics or stats of the cache
transitory -

Published by aholstenson about 7 years ago

  • cleanUp() is now part of the public API. It can be used toequest clean up of the cache by removing expired entries and old data. In most cases this is not needed. See README for details.
  • All caches now share a common base class to allow for checks using instanceof: if(obj instanceof transitory.Cache)
transitory -

Published by aholstenson over 7 years ago

  • Human friendly arguments in builder
  • clear() and keys() added to Cache API
transitory -

Published by aholstenson over 7 years ago

  • Improved hit rates
  • Expiration of entries now evaluated on set and delete
transitory -

Published by aholstenson over 7 years ago

  • Added support for metrics
  • Improved hit rate for bounded cache