# sindresorhus/memoize

Memoize functions - an optimization technique used to speed up consecutive function calls by caching the result of calls with identical input

Repository: https://github.com/sindresorhus/memoize
Canonical: https://ross.abutalabs.com/products/memoize
Language: TypeScript
License: MIT
License Family: permissive
Last push: 2026-07-21T16:42:15+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 93, release rhythm 43, longevity 100
- inputs: {"age_days": 3908, "days_push": 43, "days_rel": 167, "gap_med": 196.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1163, forks 55 (observed 2026-08-28T04:03:49.727303+00:00)

## What it is
A TypeScript library for memoizing functions, caching results of calls with identical input to speed up consecutive invocations. It supports TTL-based expiration, custom caching strategies, and automatic memory release.

## Use cases
- memoize expensive function calls in javascript
- cache function results by input arguments
- add ttl expiration to memoized functions
- speed up repeated function calls with same arguments
- memoize functions with custom cache keys
- avoid recomputing pure function results

## When to choose
- you need lightweight function-level caching in Node.js or the browser
- you want TTL-based cache expiration with automatic memory cleanup
- you need customizable caching strategies like multi-argument keys or WeakMap caching
- you prefer a small, well-maintained ESM package

## When to avoid
- you need to memoize promise-returning functions with promise-specific behaviors - use p-memoize instead
- you need a distributed or persistent cache rather than in-memory function memoization
- your functions have side effects and caching results would be incorrect

## Facets
- artifact type: library
- maturity: active
- function: caching, concurrency
- domain: developer-tools, performance
- platform: browser, bun
- tags: memoization, typescript, ttl-cache, function-optimization, npm, javascript, nodejs, deno

## Member repositories
- sindresorhus/memoize (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:03:49.727303+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T06:31:35.258911+00:00, confidence not recorded.
  - readme: https://github.com/sindresorhus/memoize (fetched 2026-08-28T04:03:49.727303+00:00, sha b5bee2ac5e63)
  - registry_npm: https://registry.npmjs.org/memoize (fetched 2026-08-29T12:36:05.491062+00:00, sha 7b34e201ab0f)
- Data as of 2026-08-30T08:39:29.467469+00:00.
