{"id":15672963,"url":"https://github.com/yields/lru-cache","last_synced_at":"2025-06-14T19:04:29.532Z","repository":{"id":11250036,"uuid":"13648700","full_name":"yields/lru-cache","owner":"yields","description":"LRU Cache","archived":false,"fork":false,"pushed_at":"2013-10-26T01:11:06.000Z","size":120,"stargazers_count":15,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-06T22:11:30.719Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yields.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-17T12:47:26.000Z","updated_at":"2018-03-29T12:53:51.000Z","dependencies_parsed_at":"2022-09-14T21:01:31.275Z","dependency_job_id":null,"html_url":"https://github.com/yields/lru-cache","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yields/lru-cache","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yields%2Flru-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yields%2Flru-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yields%2Flru-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yields%2Flru-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yields","download_url":"https://codeload.github.com/yields/lru-cache/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yields%2Flru-cache/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259868319,"owners_count":22924231,"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-10-03T15:34:20.555Z","updated_at":"2025-06-14T19:04:29.510Z","avatar_url":"https://github.com/yields.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# lru-cache\n\n  LRU Cache\n\n## Installation\n\n  Install with [component(1)](http://component.io):\n\n    $ component install yields/lru-cache\n\n## API\n\n### Cache(opts)\n\n  Initialize `Cache` with `opts`\n\n  - `.max` max items.\n\n#### #set\n\n  Set `key`, `val`.\n  `key` may be an object.\n\n  an optional `ttl` may be given, if omitted the global `ttl` is used.\n\n    var c = cache();\n    c.set('a', 'b', '5ms');\n\n#### #get\n\n  Get `key`'s value, and promote it.\n\n#### #has\n\n  Check if `key` exists.\n\n#### #remove\n\n  Remove `key`\n\n#### #max\n\n  Set `max` vals and remove items if necessary.\n\n#### #ttl\n\n  Set `ttl` for all values, you can override this at a value level.\n\n    var c = cache({ ttl: '2ms' });\n    c.ttl('5ms');\n    c.set('a', 'b', '1ms');\n    c.set('d', 'c'); // =\u003e 5ms\n\n  by default `ttl` is `0`, which means no values will expire.\n\n#### #toJSON\n\n  Get a cloned cache with `{ key: val }` structure.\n\n#### #promote\n\n  Manually promote `key`.\n\n## License\n\n  MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyields%2Flru-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyields%2Flru-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyields%2Flru-cache/lists"}