A memoization library for JavaScript functions that caches results to optimize consecutive calls with identical input.
Memoize is a JavaScript library that implements memoization, a technique to optimize function performance by caching the results of previous calls. When a memoized function is called with the same arguments, it returns the cached result instead of recomputing, significantly speeding up repeated operations. It's particularly useful for expensive computations, API requests, or any function where inputs repeat frequently.
JavaScript developers working on performance-sensitive applications, especially those dealing with expensive function calls, repeated calculations, or caching strategies. It's also suitable for library authors who want to add memoization to their APIs.
Developers choose Memoize for its balance of simplicity and flexibility—it works out of the box with sensible defaults but allows deep customization through cache keys, storage backends, and expiration policies. Its decorator support and utilities for cache inspection make it a comprehensive solution for memoization in modern JavaScript.
Memoize functions - an optimization technique used to speed up consecutive function calls by caching the result of calls with identical input
Allows custom cacheKey functions and alternative stores like WeakMap, enabling memoization of complex arguments such as objects using JSON.stringify.
Cache entries expire based on configurable maxAge, preventing memory leaks by automatically clearing stale data without manual intervention.
Provides memoizeDecorator for memoizing class methods and getters using TC39 stage 3 decorators, simplifying integration in modern JavaScript.
Includes memoizeIsCached and memoizeClear functions to check cache status and clear entries, aiding in debugging and control.
Only the first argument is considered by default, which can lead to incorrect caching for multi-parameter functions unless a custom cacheKey is explicitly set.
Memoizing non-serializable arguments requires adding libraries like many-keys-map, increasing bundle size and setup complexity beyond the core library.
Relies on TC39 stage 3 decorators, which may not be natively supported in older environments, necessitating transpilation and limiting out-of-the-box use.
Git hooks made easy 🐶 woof!
A JavaScript implementation of various web standards, for use with Node.js
Loads environment variables from .env for nodejs projects.
Fix broken node modules instantly 🏃🏽♀️💨
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.