memoize is a JavaScript package for accelerating repeated function calls by caching results for previously seen inputs. By default, it builds cache identity from the function's first argument using strict equality. Developers can supply custom cache-key functions when multiple arguments or value-based object comparisons are required. Cache entries can expire after a configurable duration, and storage can be replaced with Map-compatible implementations such as LRU caches. Utilities are provided for clearing cached values and checking whether a particular call is currently cached. The package also includes a decorator for memoizing class methods and getters in modern TypeScript and JavaScript environments. It can work with promise-returning functions, although the project recommends specialized alternatives for advanced async behavior.

Features

  • Function result caching
  • Configurable cache expiration
  • Custom cache-key generation
  • Replaceable Map-compatible cache storage
  • Cache clearing and presence checking
  • Class method and getter memoization decorators

Project Samples

Project Activity

See All Activity >

Categories

Terminals

License

MIT License

Follow memoize

memoize Web Site

Other Useful Business Software
Build Agents and Models on One Platform Icon
Build Agents and Models on One Platform

Everything you need to build production-ready agents and models. Access 200+ Google and third-party AI models and tools.

Gemini Enterprise Agent Platform is Google Cloud's comprehensive platform for developers to build, scale, govern, and optimize agents and models. Choose from Google's most advanced models and third-party models like Anthropic's Claude Model Family.
Start Free
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of memoize!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript Terminals

Registered

12 hours ago