{"id":17399258,"url":"https://github.com/feross/cache-chunk-store","last_synced_at":"2025-09-13T01:32:12.222Z","repository":{"id":36485906,"uuid":"40791497","full_name":"feross/cache-chunk-store","owner":"feross","description":"In-memory LRU (least-recently-used) cache for abstract-chunk-store compliant stores","archived":false,"fork":false,"pushed_at":"2023-01-30T09:04:31.000Z","size":45,"stargazers_count":28,"open_issues_count":3,"forks_count":4,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-01-03T02:53:09.886Z","etag":null,"topics":["abstract-chunk-store","cache","in-memory","javascript","lru","nodejs"],"latest_commit_sha":null,"homepage":"","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/feross.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}},"created_at":"2015-08-15T23:29:20.000Z","updated_at":"2024-09-25T09:10:51.000Z","dependencies_parsed_at":"2023-02-18T01:00:26.484Z","dependency_job_id":null,"html_url":"https://github.com/feross/cache-chunk-store","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Fcache-chunk-store","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Fcache-chunk-store/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Fcache-chunk-store/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Fcache-chunk-store/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feross","download_url":"https://codeload.github.com/feross/cache-chunk-store/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232806948,"owners_count":18579340,"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":["abstract-chunk-store","cache","in-memory","javascript","lru","nodejs"],"created_at":"2024-10-16T15:14:18.480Z","updated_at":"2025-01-07T01:05:59.392Z","avatar_url":"https://github.com/feross.png","language":"JavaScript","readme":"# cache-chunk-store [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]\n\n[ci-image]: https://img.shields.io/github/workflow/status/feross/cache-chunk-store/ci/master\n[ci-url]: https://github.com/feross/cache-chunk-store/actions\n[npm-image]: https://img.shields.io/npm/v/cache-chunk-store.svg\n[npm-url]: https://npmjs.org/package/cache-chunk-store\n[downloads-image]: https://img.shields.io/npm/dm/cache-chunk-store.svg\n[downloads-url]: https://npmjs.org/package/cache-chunk-store\n[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg\n[standard-url]: https://standardjs.com\n\n#### In-memory LRU (least-recently-used) cache for [abstract-chunk-store](https://github.com/mafintosh/abstract-chunk-store) compliant stores\n\n[![abstract chunk store](https://cdn.rawgit.com/mafintosh/abstract-chunk-store/master/badge.svg)](https://github.com/mafintosh/abstract-chunk-store)\n\nThis caches the results of `store.get()` calls using\n[`lru`](https://www.npmjs.com/package/lru). See the `lru` docs for the\nfull list of configuration options.\n\n## Install\n\n```\nnpm install cache-chunk-store\n```\n\n## Usage\n\n``` js\nconst CacheChunkStore = require('cache-chunk-store')\nconst FSChunkStore = require('fs-chunk-store') // any chunk store will work\n\nconst store = new CacheChunkStore(new FSChunkStore(10), {\n  // options are passed through to `lru-cache`\n  max: 100 // maximum cache size (this is probably the only option you need)\n})\n\nstore.put(0, new Buffer('abc'), err =\u003e {\n  if (err) throw err\n\n  store.get(0, (err, data) =\u003e {\n    if (err) throw err\n    console.log(data)\n\n    // this will be super fast because it's cached in memory!\n    store.get(0, (err, data) =\u003e {\n      if (err) throw err\n      console.log(data)\n    })\n  })\n})\n\n```\n\n## License\n\nMIT. Copyright (c) [Feross Aboukhadijeh](https://feross.org).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeross%2Fcache-chunk-store","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeross%2Fcache-chunk-store","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeross%2Fcache-chunk-store/lists"}