{"id":16398668,"url":"https://github.com/ken107/memoize","last_synced_at":"2026-02-21T21:05:42.379Z","repository":{"id":42960013,"uuid":"229012597","full_name":"ken107/memoize","owner":"ken107","description":"Extensible memoize that allows plugin arbitrary cache implementation, supporting multiple layers of caches","archived":false,"fork":false,"pushed_at":"2024-05-28T03:39:42.000Z","size":679,"stargazers_count":1,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-30T10:31:09.127Z","etag":null,"topics":["cache","memcached","memoize","nodejs"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ken107.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-19T08:46:56.000Z","updated_at":"2025-01-25T16:57:58.000Z","dependencies_parsed_at":"2024-05-28T07:02:20.261Z","dependency_job_id":null,"html_url":"https://github.com/ken107/memoize","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken107%2Fmemoize","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken107%2Fmemoize/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken107%2Fmemoize/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ken107%2Fmemoize/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ken107","download_url":"https://codeload.github.com/ken107/memoize/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245451396,"owners_count":20617509,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cache","memcached","memoize","nodejs"],"created_at":"2024-10-11T05:13:27.589Z","updated_at":"2025-10-25T02:34:58.373Z","avatar_url":"https://github.com/ken107.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n### Usage\n\n```typescript\nimport memoize from \"extensible-memoize\";\nconst getItem = memoize(fetchItem);\n\n//define your fetch function:\nfunction fetchItem(key: K): Promise\u003cV\u003e {\n  //fetch the item identified by key\n}\n```\n\n*Note*: `K` must be one of `void`, `string`, or `extends {hashKey: string}` (an object with a hashKey property)\n\n\n### Caching\n\nBy default, memoize uses a mem cache with no expiration.  To specify your own caching implementation, pass an array of Caches as the second parameter.\n\n```typescript\ninterface Cache\u003cK, V\u003e {\n  get: (key: K) =\u003e Promise\u003cV\u003e\n  set: (key: K, value: V) =\u003e Promise\u003cvoid\u003e\n}\n\nconst getItem = memoize(fetchItem, [cache1, cache2, ...]);\n```\n\nMemoize will first look for the item in `cache1`, then in `cache2`, and so on.  If the item is not found in the caches, `fetchItem` will be called.  Note that your cache implementations do not have to worry about dealing with concurrency, memoize will take care of that.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fken107%2Fmemoize","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fken107%2Fmemoize","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fken107%2Fmemoize/lists"}