{"id":23395711,"url":"https://github.com/theonlybeardedbeast/timed-memory-cache","last_synced_at":"2026-05-07T09:35:41.163Z","repository":{"id":116205871,"uuid":"346799420","full_name":"TheOnlyBeardedBeast/timed-memory-cache","owner":"TheOnlyBeardedBeast","description":"Timed memory cache","archived":false,"fork":false,"pushed_at":"2021-03-12T08:58:24.000Z","size":152,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-20T22:51:49.437Z","etag":null,"topics":["cache","memory-storage","nodejs","storage","ttl","ttl-cache","typescript"],"latest_commit_sha":null,"homepage":"","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/TheOnlyBeardedBeast.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-03-11T18:28:58.000Z","updated_at":"2023-03-07T08:22:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"ca29906b-5bd2-4c1a-b12a-4ae0e79f851e","html_url":"https://github.com/TheOnlyBeardedBeast/timed-memory-cache","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TheOnlyBeardedBeast/timed-memory-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOnlyBeardedBeast%2Ftimed-memory-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOnlyBeardedBeast%2Ftimed-memory-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOnlyBeardedBeast%2Ftimed-memory-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOnlyBeardedBeast%2Ftimed-memory-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheOnlyBeardedBeast","download_url":"https://codeload.github.com/TheOnlyBeardedBeast/timed-memory-cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheOnlyBeardedBeast%2Ftimed-memory-cache/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32731756,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-07T02:14:30.463Z","status":"ssl_error","status_checked_at":"2026-05-07T02:14:29.405Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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","memory-storage","nodejs","storage","ttl","ttl-cache","typescript"],"created_at":"2024-12-22T07:17:02.353Z","updated_at":"2026-05-07T09:35:41.158Z","avatar_url":"https://github.com/TheOnlyBeardedBeast.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TimedMemoryCache\n\nA cache which stores its entries for some time.\n\n# Class: Cache\u003cT\\\u003e\n\n## Type parameters\n\n| Name | Default   |\n| :--- | :-------- |\n| `T`  | _unknown_ |\n\n## Table of contents\n\n### Constructors\n\n- [constructor](README.md#constructor)\n\n### Accessors\n\n- [length](README.md#length)\n\n### Methods\n\n- [clear](README.md#clear)\n- [get](README.md#get)\n- [has](README.md#has)\n- [remove](README.md#remove)\n- [set](README.md#set)\n\n## Constructors\n\n### constructor\n\n\\+ **new Cache**\u003cT\\\u003e(`options?`: [_ICahceOptions_](./docs/interfaces/icahceoptions.md)\u003cT\\\u003e): [_Cache_](README.md)\u003cT\\\u003e\n\n#### Type parameters:\n\n| Name | Default   |\n| :--- | :-------- |\n| `T`  | _unknown_ |\n\n#### Parameters:\n\n| Name       | Type                                                      |\n| :--------- | :-------------------------------------------------------- |\n| `options?` | [_ICahceOptions_](./docs/interfaces/icahceoptions.md)\u003cT\\\u003e |\n\n**Returns:** [_Cache_](README.md)\u003cT\\\u003e\n\n#### Examples:\n\n```typescript\nimport Cache from 'timed-memory-cache';\n\nconst cache = new Cache\u003cstring\u003e();\n```\n\n## Accessors\n\n### length\n\n• get **length**(): _number_\n\nReturns the number of entries in the cache\n\n**Returns:** _number_\n\n#### Examples:\n\n```typescript\nconst cacheEntryCount = cache.length;\n```\n\n---\n\n## Methods\n\n### clear\n\n▸ **clear**(): _void_\n\nClears the cache\n\n**Returns:** _void_\n\n#### Examples:\n\n```typescript\ncache.clear();\n```\n\n### get\n\n▸ **get**(`key`: _string_): T | undefined\n\nReturns the value for a given key\nor undefined if nothing found\n\n#### Parameters:\n\n| Name  | Type     |\n| :---- | :------- |\n| `key` | _string_ |\n\n**Returns:** T | undefined\n\n#### Examples:\n\n```typescript\nconst value = cache.get('myKey');\n```\n\n### has\n\n▸ **has**(`key`: _string_): _boolean_\n\nCheck if an entry with given key exists\n\n#### Parameters:\n\n| Name  | Type     |\n| :---- | :------- |\n| `key` | _string_ |\n\n**Returns:** _boolean_\n\n#### Examples:\n\n```typescript\nconst valueExists = cache.has('myKey');\n```\n\n### remove\n\n▸ **remove**(`key`: _string_): _void_\n\nRemoves an entry from the cache\n\n#### Parameters:\n\n| Name  | Type     |\n| :---- | :------- |\n| `key` | _string_ |\n\n**Returns:** _void_\n\n#### Examples:\n\n```typescript\ncache.remove('myKey');\n```\n\n### set\n\n▸ **set**(`key`: _string_, `value`: T, `options?`: [_ICacheEntryOptions_](./docs/interfaces/icacheentryoptions.md)\u003cT\\\u003e): _void_\n\nAdds a new entry into the cache\n\n#### Parameters:\n\n| Name       | Type                                                                |\n| :--------- | :------------------------------------------------------------------ |\n| `key`      | _string_                                                            |\n| `value`    | T                                                                   |\n| `options?` | [_ICacheEntryOptions_](./docs/interfaces/icacheentryoptions.md)\u003cT\\\u003e |\n\n**Returns:** _void_\n\n#### Examples:\n\n```typescript\ncache.set('myKey', 'myValue', { ttl: 120 * 1000 }, onRemove:(key,value) =\u003e { console.log(\"entry was removed after 120 seconds\")});\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheonlybeardedbeast%2Ftimed-memory-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftheonlybeardedbeast%2Ftimed-memory-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftheonlybeardedbeast%2Ftimed-memory-cache/lists"}