{"id":13622894,"url":"https://github.com/mafintosh/xache","last_synced_at":"2025-04-13T15:35:32.601Z","repository":{"id":39885302,"uuid":"369645397","full_name":"mafintosh/xache","owner":"mafintosh","description":"Yet another auto expiring, max sizable cache","archived":false,"fork":false,"pushed_at":"2024-02-07T22:07:23.000Z","size":11,"stargazers_count":50,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-07T18:46:39.551Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/mafintosh.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":"2021-05-21T20:19:10.000Z","updated_at":"2025-02-11T15:51:21.000Z","dependencies_parsed_at":"2024-06-18T19:52:23.488Z","dependency_job_id":"b3b74ab6-7bfa-4d02-af66-ca3625189cbd","html_url":"https://github.com/mafintosh/xache","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafintosh%2Fxache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafintosh%2Fxache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafintosh%2Fxache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mafintosh%2Fxache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mafintosh","download_url":"https://codeload.github.com/mafintosh/xache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248737139,"owners_count":21153714,"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":[],"created_at":"2024-08-01T21:01:25.455Z","updated_at":"2025-04-13T15:35:32.579Z","avatar_url":"https://github.com/mafintosh.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# xache\n\nYet another auto expiring, max sizable cache\n\n```\nnpm install xache\n```\n\n## Usage\n\n``` js\nconst Xache = require('xache')\n\nconst cache = new Xache({\n  maxSize: 10, // at max (ish) have 10 entries\n  maxAge: 100, // auto expire entries after (ish) 100ms\n  createMap () { // optional function to create backing storage\n    return new Map()\n  }\n})\n\n// When maxSize is hit, the oldest entries are removed\n// cache has the same api as a map\n\ncache.set('hello', 'world')\nconsole.log(cache.get('hello'))\n\nconsole.log(...cache) // iterable!\n```\n\nThat's it, nice and simple.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmafintosh%2Fxache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmafintosh%2Fxache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmafintosh%2Fxache/lists"}