{
  "id": "task_libraries:caching/javascript",
  "path": "/exapedia/javascript-caching-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "JavaScript caching libraries",
  "answer": [
    {
      "t": "fact",
      "fact": "F114"
    },
    {
      "t": "text",
      "text": " Each cache evicts entries once they pass a limit on count, total size, or time to live. These libraries hold the API responses, rendered fragments, and database results that servers, build tools, and CLIs would otherwise recompute."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "JavaScript caching libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#lru-cache",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F131"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F6"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F135"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#keyv",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F146"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#flat-cache",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F163"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#quick-lru",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F180"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F32"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F184"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#cacheable",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F195"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F199"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#cacheable-memory",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F212"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F216"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#isaacs-ttlcache",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F229"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ],
              [
                {
                  "t": "text",
                  "text": "Not on GitHub"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F233"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "npm"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#lru-cache",
          "label": [
            {
              "t": "fact",
              "fact": "F131"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F132"
        },
        {
          "t": "text",
          "text": "."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "LRU eviction",
            "Disk snapshots",
            "Async get/set"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#lru-cache",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F131"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F138"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F139"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F140"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#keyv",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F146"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F156"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#flat-cache",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F163"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F173"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#quick-lru",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F180"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F188"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#cacheable",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F195"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#cacheable-memory",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F212"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F221"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F222"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F223"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#isaacs-ttlcache",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F229"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F238"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F239"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F240"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "lru-cache",
          "name": [
            {
              "t": "fact",
              "fact": "F131"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/isaacs/node-lru-cache"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/lru-cache"
            },
            {
              "label": "Docs",
              "href": "https://cdn.jsdelivr.net/npm/lru-cache@11.5.3/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F12"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F132"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F6"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F134"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F133"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/lru-cache@11.5.3/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F131"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/npm/hosted-git-info",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F144"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "static fromUrl (giturl, opts) {\n  if (typeof giturl !== 'string') {\n    return\n  }\n\n  const key = giturl + JSON.stringify(opts || {})\n\n  if (!cache.has(key)) {\n    const hostArgs = fromUrl(giturl, opts, {\n      gitHosts: GitHost.#gitHosts,\n      protocols: GitHost.#protocols,\n    })\n    cache.set(key, hostArgs ? new GitHost(...hostArgs) : null)\n  }\n\n  return cache.get(key) ?? undefined\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/npm/hosted-git-info/blob/477bef8d76264411d911c860c8e6ca9b1e22a28d/lib/index.js#L62-L78",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F143"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=JavaScript%20applications%20using%20lru-cache%20for%20caching%20repeated%20work%2C%20bounded%20entries%2C%20expiration%20and%20storage%20configuration&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F131"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { LRUCache } from 'lru-cache';\n\nconst cache = new LRUCache({ max: 1000 });\ncache.set('key', 'value');\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/lru-cache@11.5.3/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F136"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "keyv",
          "name": [
            {
              "t": "fact",
              "fact": "F146"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/jaredwray/keyv"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/keyv"
            },
            {
              "label": "Docs",
              "href": "https://cdn.jsdelivr.net/npm/keyv@6.1.0/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F153"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F147"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/keyv@6.1.0/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F146"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F161"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F162"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/jaredwray/cacheable",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F161"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "const get = async (options_: any) => {\n\tawait Promise.resolve();\n\tconst cacheEntry = options_.cache\n\t\t? await this.cache.get(key)\n\t\t: undefined;\n\n\tif (cacheEntry === undefined && !options_.forceRefresh) {\n\t\tmakeRequest(options_);\n\t\treturn;\n\t}\n\n\tconst policy = CachePolicy.fromObject(\n\t\t(cacheEntry as CacheValue).cachePolicy,\n\t);\n\tif (\n\t\tpolicy.satisfiesWithoutRevalidation(options_) &&\n\t\t!options_.forceRefresh\n\t) {\n\t\tconst headers = convertHeaders(policy.responseHeaders());\n\t\tconst bodyBuffer = (cacheEntry as CacheValue).body;\n\t\tconst body = Buffer.from(bodyBuffer as string);\n\t\tconst response: any = new Response({\n\t\t\tstatusCode: (cacheEntry as CacheValue).statusCode,\n\t\t\theaders,\n\t\t\tbody,\n\t\t\turl: (cacheEntry as CacheValue).url,\n\t\t});\n\t\tresponse.cachePolicy = policy;\n\t\tresponse.fromCache = true;\n\t\tee.emit(\"response\", response);\n\t\tif (typeof callback === \"function\") {\n\t\t\tcallback(response);\n\t\t}\n\t} else if (\n\t\tpolicy.satisfiesWithoutRevalidation(options_) &&\n\t\tDate.now() >= policy.timeToLive() &&\n\t\toptions_.forceRefresh\n\t) {\n\t\tawait this.cache.delete(key);\n\t\toptions_.headers = policy.revalidationHeaders(options_);\n\t\tmakeRequest(options_);\n\t} else {\n\t\trevalidate = cacheEntry;\n\t\toptions_.headers = policy.revalidationHeaders(options_);\n\t\tmakeRequest(options_);\n\t}\n};\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/jaredwray/cacheable/blob/b7611eb9196ea89609b58b95b0cba9e7f0ac52f5/packages/cacheable-request/src/index.ts#L268-L314",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F160"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=keyv%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F146"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { Keyv } from 'keyv';\n\nconst cache = new Keyv();\nawait cache.set('key', 'value');\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/keyv@6.1.0/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F151"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "flat-cache",
          "name": [
            {
              "t": "fact",
              "fact": "F163"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/jaredwray/flat-cache"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/flat-cache"
            },
            {
              "label": "Docs",
              "href": "https://cdn.jsdelivr.net/npm/flat-cache@6.1.23/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F170"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F164"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/flat-cache@6.1.23/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F163"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F178"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F179"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/samestrin/llm-interface",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F178"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "async getFromCache(key) {\n  const hashedKey = this.getCacheFilePath(key);\n  try {\n    if (this.cacheType === 'flat-cache') {\n      const cachedData = this.cacheInstance.getKey(hashedKey);\n      if (cachedData && cachedData.ttl && Date.now() > cachedData.ttl) {\n        this.cacheInstance.removeKey(hashedKey);\n        this.cacheInstance.save(true);\n        return null;\n      }\n      return cachedData ? cachedData.data : null;\n    } else if (this.cacheType === 'cache-manager') {\n      if (\n        typeof this.cacheInstance?.store?.get !== 'function' &&\n        typeof this.cacheInstance?.get !== 'function'\n      ) {\n        await this.loadCacheInstance();\n      }\n\n      if (typeof this.cacheInstance?.store?.get === 'function') {\n        return await this.cacheInstance.store.get(hashedKey);\n      } else if (typeof this.cacheInstance?.get === 'function') {\n        return await this.cacheInstance.get(hashedKey);\n      } else {\n        throw new CacheError('Cache manage not available');\n      }\n    } else if (this.cacheType === 'simple-cache') {\n      return await this.cacheInstance.getFromCache(hashedKey);\n    } else if (this.cacheType === 'memory-cache') {\n      return this.cacheInstance.get(hashedKey);\n    }\n  } catch (error) {\n    console.error(error);\n    return null;\n  }\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/samestrin/llm-interface/blob/e0ffa163679a998a5e3692779a91dd2dad6ebe96/src/utils/cacheManager.js#L93-L128",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F177"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=flat-cache%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F163"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { FlatCache } from 'flat-cache';\n\nconst cache = new FlatCache();\ncache.setKey('key', 'value');\ncache.save();\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/flat-cache@6.1.23/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F168"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "quick-lru",
          "name": [
            {
              "t": "fact",
              "fact": "F180"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/sindresorhus/quick-lru"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/quick-lru"
            },
            {
              "label": "Docs",
              "href": "https://cdn.jsdelivr.net/npm/quick-lru@8.0.0/readme.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F37"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F32"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F183"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/quick-lru@8.0.0/readme.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F180"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F45"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F193"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F194"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/sanity-io/sanity",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F193"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "function createLRUCache<T>(options: {maxSize: number}): SWRCache<T> {\n  const lru = new QuickLRU<string, {value: T}>(options)\n  return {\n    get(key: string) {\n      const entry = lru.get(key)\n      if (!entry) {\n        throw new Error(`Key not found in LRU cache: ${key}`)\n      }\n      return entry.value\n    },\n    set(key: string, value: T) {\n      lru.set(key, {value})\n    },\n    delete(key: string) {\n      lru.delete(key)\n    },\n    has(key: string) {\n      return lru.has(key)\n    },\n  }\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/sanity-io/sanity/blob/d50d96424b3978196c75d0a291d9725ec85fa67f/packages/sanity/src/core/util/rxSwr.ts#L50-L70",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F192"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=JavaScript%20applications%20using%20quick-lru%20for%20caching%20repeated%20work%2C%20bounded%20entries%2C%20expiration%20and%20storage%20configuration&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F180"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import QuickLRU from 'quick-lru';\n\nconst cache = new QuickLRU({ maxSize: 1000 });\ncache.set('key', 'value');\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/quick-lru@8.0.0/readme.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "readme.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F185"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "cacheable",
          "name": [
            {
              "t": "fact",
              "fact": "F195"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/jaredwray/cacheable"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/cacheable"
            },
            {
              "label": "Docs",
              "href": "https://cdn.jsdelivr.net/npm/cacheable@2.5.0/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F202"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F198"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/cacheable@2.5.0/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F195"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F210"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F211"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/webstreamr/webstreamr",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F210"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "public async handle(ctx: Context, url: URL, meta?: Meta, allowLazy?: boolean): Promise<UrlResult[]> {\n  const extractor = this.extractors.find(extractor => !isExtractorDisabled(ctx.config, extractor) && extractor.supports(ctx, url));\n  if (!extractor) {\n    return [];\n  }\n\n  const normalizedUrl = extractor.normalize(url);\n  const cacheKey = this.determineCacheKey(ctx, extractor, normalizedUrl);\n\n  const storedDataRaw = await this.urlResultCache.getRaw<UrlResult[]>(cacheKey);\n  const expires = storedDataRaw?.expires;\n  if (storedDataRaw && expires) {\n    const ttl = expires - Date.now();\n\n    /* istanbul ignore if */\n    if (ttl > 0) {\n      return (storedDataRaw.value as UrlResult[]).map(urlResult => ({ ...urlResult, ttl, url: new URL(urlResult.url) }));\n    }\n  }\n\n  const lazyUrlResults = await this.lazyUrlResultCache.get<UrlResult[]>(normalizedUrl.href) ?? [];\n\n  /* istanbul ignore next */\n  if (\n    lazyUrlResults.length && allowLazy && !extractor.viaMediaFlowProxy\n    && lazyUrlResults.every(urlResult => urlResult.format !== Format.hls) // related to Android issues, e.g. https://github.com/Stremio/stremio-bugs/issues/1574 or https://github.com/Stremio/stremio-bugs/issues/1579\n  ) {\n    // generate lazy extract urls\n    return lazyUrlResults.map((urlResult, index) => {\n      const extractUrl = new URL(`${envGet('PROTOCOL')}:${envGet('HOST')}/extract/`);\n\n      extractUrl.searchParams.set('index', `${index}`);\n      extractUrl.searchParams.set('url', url.href);\n\n      return { ...urlResult, url: extractUrl };\n    });\n  }\n\n  this.logger.info(`Extract ${url} using ${extractor.id} extractor`, ctx);\n\n  const mergedMeta: Meta = { ...meta, ...lazyUrlResults[0]?.meta };\n  const urlResults = await extractor.extract(ctx, normalizedUrl, { extractorId: extractor.id, ...mergedMeta });\n\n  if (!Object.keys(mergedMeta).length || urlResults.some(urlResult => urlResult.error)) {\n    await this.urlResultCache.delete(cacheKey);\n    await this.lazyUrlResultCache.delete(normalizedUrl.href);\n\n    return urlResults;\n  }\n\n  const ttl = urlResults.length ? extractor.ttl : 43200000; // 12h\n\n  await this.urlResultCache.set<UrlResult[]>(cacheKey, urlResults, ttl);\n\n  if (extractor.id !== 'external') {\n    await this.lazyUrlResultCache.set<UrlResult[]>(normalizedUrl.href, urlResults, 2629800000); // 1 month\n  }\n\n  return urlResults;\n};\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/webstreamr/webstreamr/blob/720c9bb651a7a06a62f5f3636099b5cfb7506bcb/src/extractor/ExtractorRegistry.ts#L40-L99",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F209"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=cacheable%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F195"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { Cacheable } from 'cacheable';\n\nconst cache = new Cacheable();\nawait cache.set('key', 'value');\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/cacheable@2.5.0/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F200"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "cacheable-memory",
          "name": [
            {
              "t": "fact",
              "fact": "F212"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/jaredwray/cacheable"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@cacheable/memory"
            },
            {
              "label": "Docs",
              "href": "https://cdn.jsdelivr.net/npm/@cacheable/memory@2.2.0/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F219"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F215"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/@cacheable/memory@2.2.0/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F212"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F228"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/webstreamr/webstreamr",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F227"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "javascript",
              "code": "public constructor(logger: winston.Logger, extractors: Extractor[]) {\n  this.logger = logger;\n  this.extractors = extractors;\n\n  this.urlResultCache = new Cacheable({\n    nonBlocking: true,\n    primary: new Keyv({ store: new CacheableMemory({ lruSize: 1024 }) }),\n    secondary: createKeyvSqlite('extractor-cache'),\n    stats: true,\n  });\n\n  this.lazyUrlResultCache = new Cacheable({\n    nonBlocking: true,\n    primary: new Keyv({ store: new CacheableMemory({ lruSize: 1024 }) }),\n    secondary: createKeyvSqlite('extractor-lazy-cache'),\n    stats: true,\n  });\n}\n",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/webstreamr/webstreamr/blob/720c9bb651a7a06a62f5f3636099b5cfb7506bcb/src/extractor/ExtractorRegistry.ts#L14-L31",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F226"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=%40cacheable/memory%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F212"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { CacheableMemory } from '@cacheable/memory';\n\nconst cache = new CacheableMemory();\ncache.set('key', 'value');\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/@cacheable/memory@2.2.0/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F217"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "isaacs-ttlcache",
          "name": [
            {
              "t": "fact",
              "fact": "F229"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/isaacs/ttlcache"
            },
            {
              "label": "npm",
              "href": "https://www.npmjs.com/package/@isaacs/ttlcache"
            },
            {
              "label": "Docs",
              "href": "https://cdn.jsdelivr.net/npm/@isaacs/ttlcache@2.1.5/README.md"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F236"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F230"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/@isaacs/ttlcache@2.1.5/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F229"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "javascript",
              "code": "import { TTLCache } from '@isaacs/ttlcache';\n\nconst cache = new TTLCache({ max: 10000, ttl: 1000 });\ncache.set('key', 'value');\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://cdn.jsdelivr.net/npm/@isaacs/ttlcache@2.1.5/README.md",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=%40isaacs/ttlcache%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F229"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F234"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "What is an LRU cache in JavaScript?",
      "a": [
        {
          "t": "text",
          "text": "An LRU (least recently used) cache keeps a bounded number of entries and evicts the entry read longest ago when it fills. "
        },
        {
          "t": "link",
          "href": "#lru-cache",
          "label": [
            {
              "t": "text",
              "text": "LRUCache"
            }
          ]
        },
        {
          "t": "text",
          "text": " and "
        },
        {
          "t": "link",
          "href": "#quick-lru",
          "label": [
            {
              "t": "text",
              "text": "QuickLRU"
            }
          ]
        },
        {
          "t": "text",
          "text": " work this way, while "
        },
        {
          "t": "link",
          "href": "#isaacs-ttlcache",
          "label": [
            {
              "t": "text",
              "text": "TTLCache"
            }
          ]
        },
        {
          "t": "text",
          "text": " evicts the soonest-expiring entries instead."
        }
      ]
    },
    {
      "q": "Does an entry TTL remove stale values immediately?",
      "a": [
        {
          "t": "fact",
          "fact": "F115"
        },
        {
          "t": "text",
          "text": " "
        },
        {
          "t": "fact",
          "fact": "F116"
        }
      ]
    },
    {
      "q": "Does QuickLRU enforce a strict maxSize entry count?",
      "a": [
        {
          "t": "fact",
          "fact": "F118"
        }
      ]
    },
    {
      "q": "Can lru-cache store undefined as a cached result?",
      "a": [
        {
          "t": "fact",
          "fact": "F123"
        }
      ]
    },
    {
      "q": "Can lru-cache load a value asynchronously?",
      "a": [
        {
          "t": "fact",
          "fact": "F124"
        }
      ]
    },
    {
      "q": "How does Keyv store data in Redis?",
      "a": [
        {
          "t": "link",
          "href": "#keyv",
          "label": [
            {
              "t": "text",
              "text": "Keyv"
            }
          ]
        },
        {
          "t": "text",
          "text": " keeps data in an in-memory Map by default and reaches Redis or other databases through storage adapters."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, lru-cache",
      "display": "lru-cache",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, lru-cache",
      "display": "3.0B",
      "asOf": "2026-11-15"
    },
    "F3": {
      "label": "License, lru-cache",
      "display": "BlueOak-1.0.0",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, lru-cache",
      "display": "11.5.3",
      "asOf": "2026-11-17"
    },
    "F5": {
      "label": "Undated package release, lru-cache",
      "display": "v11.5.3",
      "asOf": "2026-11-17"
    },
    "F6": {
      "label": "Repository stars, lru-cache",
      "display": "5.9K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Entry TTL, lru-cache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Capacity limit, lru-cache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Async loading, lru-cache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Removal callbacks, lru-cache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Install, lru-cache",
      "display": "npm install lru-cache",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "What it does, lru-cache",
      "display": "Stores recently used entries with configurable size bounds, expiration, and asynchronous loading.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, lru-cache",
      "display": "Bounds the entry count",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, lru-cache",
      "display": "Set max to retain a fixed number of recently accessed entries.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths lead, lru-cache",
      "display": "Loads values asynchronously",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths, lru-cache",
      "display": "Set fetchMethod and call fetch for asynchronous cache loading.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations lead, lru-cache",
      "display": "Expired entries wait for access",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations, lru-cache",
      "display": "Enable ttlAutopurge when stale entries need proactive removal.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations lead, lru-cache",
      "display": "Undefined values are not stored",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations, lru-cache",
      "display": "Use a sentinel when undefined is a meaningful cached result.",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Quickstart, lru-cache",
      "display": "import { LRUCache } from 'lru-cache'\n\nconst cache = new LRUCache<string, any>({\n  ttl: 100,\n  fetchMethod: async (url, oldValue, { signal }) =>  {\n    const res = await fetch(url, { signal })\n    return await res.json()\n  }\n})\ncache.set('https://example.com/', { some: 'data' })\n// 100ms go by...\nconst result = cache.fetch('https://example.com/')\ncache.set('https://example.com/', { other: 'thing' })\nconsole.log(await result) // { some: 'data' }\nconsole.log(cache.get('https://example.com/')) // { other: 'thing' }\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function, lru-cache",
      "display": "static fromUrl (giturl, opts) {\n    if (typeof giturl !== 'string') {\n      return\n    }\n\n    const key = giturl + JSON.stringify(opts || {})\n\n    if (!cache.has(key)) {\n      const hostArgs = fromUrl(giturl, opts, {\n        gitHosts: GitHost.#gitHosts,\n        protocols: GitHost.#protocols,\n      })\n      cache.set(key, hostArgs ? new GitHost(...hostArgs) : null)\n    }\n\n    return cache.get(key) ?? undefined\n  }\n",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project function reference, lru-cache",
      "display": "index.js · fromUrl()",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project repository, lru-cache",
      "display": "npm/hosted-git-info",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project stars, npm/hosted-git-info",
      "display": "240",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Project push date, npm/hosted-git-info",
      "display": "Oct 2026",
      "asOf": "2026-10-30"
    },
    "F27": {
      "label": "Library name, quick-lru",
      "display": "quick-lru",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Monthly downloads, quick-lru",
      "display": "232.4M",
      "asOf": "2026-11-15"
    },
    "F29": {
      "label": "License, quick-lru",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Package release, quick-lru",
      "display": "8.0.0",
      "asOf": "2026-11-17"
    },
    "F31": {
      "label": "Undated package release, quick-lru",
      "display": "v8.0.0",
      "asOf": "2026-11-17"
    },
    "F32": {
      "label": "Repository stars, quick-lru",
      "display": "775",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Entry TTL, quick-lru",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Capacity limit, quick-lru",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Removal callbacks, quick-lru",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Install, quick-lru",
      "display": "npm install quick-lru",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "What it does, quick-lru",
      "display": "Provides a Map-based in-memory cache with approximate LRU eviction and optional expiration.",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths lead, quick-lru",
      "display": "Fits Map-based application code",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths, quick-lru",
      "display": "Use a Map subclass with familiar cache access methods.",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths lead, quick-lru",
      "display": "Supports per-entry expiration",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths, quick-lru",
      "display": "Set maxAge globally or specify expiration for individual entries.",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "limitations lead, quick-lru",
      "display": "Size can exceed the target",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations, quick-lru",
      "display": "Stored entries can exceed maxSize before batch eviction.",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations lead, quick-lru",
      "display": "Expired entries are removed lazily",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations, quick-lru",
      "display": "Removal waits for a read, iteration, or eviction.",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Quickstart, quick-lru",
      "display": "import QuickLRU from 'quick-lru';\n\nconst lru = new QuickLRU({maxSize: 1000});\n\nlru.set('🦄', '🌈');\n\nlru.has('🦄');\n//=> true\n\nlru.get('🦄');\n//=> '🌈'\n",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project function, quick-lru",
      "display": "function createLRUCache<T>(options: {maxSize: number}): SWRCache<T> {\n  const lru = new QuickLRU<string, {value: T}>(options)\n  return {\n    get(key: string) {\n      const entry = lru.get(key)\n      if (!entry) {\n        throw new Error(`Key not found in LRU cache: ${key}`)\n      }\n      return entry.value\n    },\n    set(key: string, value: T) {\n      lru.set(key, {value})\n    },\n    delete(key: string) {\n      lru.delete(key)\n    },\n    has(key: string) {\n      return lru.has(key)\n    },\n  }\n}\n",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project function reference, quick-lru",
      "display": "rxSwr.ts · createLRUCache()",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project repository, quick-lru",
      "display": "sanity-io/sanity",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project stars, sanity-io/sanity",
      "display": "6.4K",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project push date, sanity-io/sanity",
      "display": "Nov 2026",
      "asOf": "2026-11-17"
    },
    "F52": {
      "label": "Library name, node-cache",
      "display": "node-cache",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Monthly downloads, node-cache",
      "display": "24.1M",
      "asOf": "2026-11-15"
    },
    "F54": {
      "label": "License, node-cache",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Package release, node-cache",
      "display": "5.1.2",
      "asOf": "2026-11-17"
    },
    "F56": {
      "label": "Undated package release, node-cache",
      "display": "v5.1.2",
      "asOf": "2026-11-17"
    },
    "F57": {
      "label": "Repository stars, node-cache",
      "display": "2.4K",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Entry TTL, node-cache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Capacity limit, node-cache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Removal callbacks, node-cache",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Install, node-cache",
      "display": "npm install node-cache",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "What it does, node-cache",
      "display": "Stores process-local values with per-key TTLs, expiry checks, and cache statistics.",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "strengths lead, node-cache",
      "display": "Expires entries with periodic checks",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths, node-cache",
      "display": "Configure stdTTL and checkperiod for timed cache cleanup.",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths lead, node-cache",
      "display": "Returns copied values by default",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths, node-cache",
      "display": "Keep reads isolated from the original cached object.",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "limitations lead, node-cache",
      "display": "Full caches reject new entries",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "limitations, node-cache",
      "display": "maxKeys throws when a new entry exceeds the configured limit.",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "limitations lead, node-cache",
      "display": "TTL values use seconds",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "limitations, node-cache",
      "display": "Convert millisecond durations before passing them as ttl.",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "Quickstart, node-cache",
      "display": "const NodeCache = require( \"node-cache\" );\nconst myCache = new NodeCache();\n\nconst obj = { my: \"Special\", variable: 42 };\nconst obj2 = { my: \"other special\", variable: 1337 };\n\nconst success = myCache.mset([\n\t{key: \"myKey\", val: obj, ttl: 10000},\n\t{key: \"myKey2\", val: obj2},\n])\n\nmyCache.getStats();\n\t/*\n\t\t{\n\t\t\tkeys: 0,    // global key count\n\t\t\thits: 0,    // global hit count\n\t\t\tmisses: 0,  // global miss count\n\t\t\tksize: 0,   // global key size count in approximately bytes\n\t\t\tvsize: 0    // global value size count in approximately bytes\n\t\t}\n\t*/\n",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Library name, cache-manager",
      "display": "cache-manager",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Monthly downloads, cache-manager",
      "display": "23.4M",
      "asOf": "2026-11-15"
    },
    "F74": {
      "label": "License, cache-manager",
      "display": "MIT",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Package release, cache-manager",
      "display": "7.2.9",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Undated package release, cache-manager",
      "display": "v7.2.9",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Repository stars, cache-manager",
      "display": "2.0K",
      "asOf": "2026-11-17"
    },
    "F78": {
      "label": "Entry TTL, cache-manager",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Capacity limit, cache-manager",
      "display": "Via plugin",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "Async loading, cache-manager",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Removal callbacks, cache-manager",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F82": {
      "label": "Install, cache-manager",
      "display": "npm install cache-manager",
      "asOf": "2026-11-17"
    },
    "F83": {
      "label": "What it does, cache-manager",
      "display": "Wraps functions with caching and combines prioritized Keyv-compatible storage tiers.",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "strengths lead, cache-manager",
      "display": "Combines prioritized cache stores",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "strengths, cache-manager",
      "display": "Read from the highest-priority populated cache tier.",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "strengths lead, cache-manager",
      "display": "Refreshes expiring values in background",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "strengths, cache-manager",
      "display": "Set refreshThreshold to update cached values before expiry.",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "limitations lead, cache-manager",
      "display": "Background refresh requires an expiry",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "limitations, cache-manager",
      "display": "Set ttl before expecting background refresh.",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "limitations lead, cache-manager",
      "display": "Serialization can change stored values",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "limitations, cache-manager",
      "display": "Configure Keyv serialization when caching symbols or binary arrays.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "Quickstart, cache-manager",
      "display": "import { createCache } from 'cache-manager';\n\nconst cache = createCache();\nconst result = await cache.get('key');\n// result will be undefined if the key is not found or expired\nconsole.log(result); // undefined\n",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "Project function, cache-manager",
      "display": "export function createCacheManager(): Provider {\n  return {\n    provide: CACHE_MANAGER,\n    useFactory: async (options: CacheManagerOptions) => {\n      const cachingFactory = async (\n        store: Keyv | KeyvStoreAdapter | Cacheable,\n        options: Omit<CacheManagerOptions, 'stores'>,\n      ): Promise<Keyv | Cacheable> => {\n        // If it's a Cacheable instance, return it directly to preserve nonBlocking mode\n        if (isCacheable(store)) {\n          return store;\n        }\n        if (isKeyvInstance(store)) {\n          // Apply the module namespace unless the instance has a custom one\n          // (\"keyv\" is Keyv's default, so it is treated as not set).\n          // TTL is not applied here as cache-manager already passes the module ttl on every write.\n          if (\n            options.namespace &&\n            (!store.namespace || store.namespace === 'keyv')\n          ) {\n            store.namespace = options.namespace;\n          }\n          return store;\n        }\n        const keyv = new Keyv({\n          store,\n          ttl: options.ttl,\n          namespace: options.namespace,\n        });\n        return keyv;\n      };\n\n      const stores = Array.isArray(options.stores)\n        ? await Promise.all(\n            options.stores.map(store => cachingFactory(store, options)),\n          )\n        : options.stores\n          ? [await cachingFactory(options.stores, options)]\n          : undefined;\n\n      const cacheManager = stores\n        ? createCache({\n            ...options,\n            stores: stores as Keyv[],\n          })\n        : createCache({\n            ttl: options.ttl,\n            refreshThreshold: options.refreshThreshold,\n            nonBlocking: options.nonBlocking,\n          });\n\n      // Disconnect in `onApplicationShutdown`, after the HTTP server has closed\n      // and after the `onModuleDestroy` phase, where workers drain: work still\n      // in flight before that may use the cache.\n      (cacheManager as any).onApplicationShutdown = async () => {\n        if (!stores) {\n          return;\n        }\n        await Promise.all(stores.map(async store => store.disconnect()));\n      };\n      return cacheManager;\n    },\n    inject: [MODULE_OPTIONS_TOKEN],\n  };\n}\n",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "Project function reference, cache-manager",
      "display": "cache.providers.ts · createCacheManager()",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "Project repository, cache-manager",
      "display": "nestjs/cache-manager",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "Project stars, nestjs/cache-manager",
      "display": "169",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "Project push date, nestjs/cache-manager",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F98": {
      "label": "Developer need",
      "display": "Bounding recently accessed entries",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Why choose lru-cache",
      "display": "explicit entry-count bounds",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Developer need in introduction",
      "display": "bounding recently accessed entries",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "When to consider cache-manager",
      "display": "values need multiple storage tiers",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Developer need",
      "display": "Adapting Map-based code",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Why choose quick-lru",
      "display": "a Map-compatible cache API",
      "asOf": "2026-11-17"
    },
    "F104": {
      "label": "Developer need in introduction",
      "display": "adapting Map-based code",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "When to consider lru-cache",
      "display": "a strict entry count matters",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Developer need",
      "display": "Periodic expiry cleanup",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "Why choose node-cache",
      "display": "scheduled expiry checks",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Developer need in introduction",
      "display": "periodic expiry cleanup",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "When to consider lru-cache",
      "display": "full caches should evict rather than reject entries",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "Developer need",
      "display": "Combining multiple cache stores",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "Why choose cache-manager",
      "display": "prioritized cache tiers",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "Developer need in introduction",
      "display": "combining multiple cache stores",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "When to consider quick-lru",
      "display": "a local Map-style cache is sufficient",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "Page introduction",
      "display": "JavaScript caching libraries keep computed or fetched results in memory or storage for reuse.",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "FAQ: Does an entry TTL remove stale values immediately?",
      "display": "lru-cache removes expired values when they are read, unless ttlAutopurge enables preemptive deletion.",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "FAQ: Does an entry TTL remove stale values immediately?",
      "display": "quick-lru removes expired values lazily on reads, iteration, or eviction.",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "FAQ: Does an entry TTL remove stale values immediately?",
      "display": "node-cache provides a periodic expiry check interval.",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "FAQ: Does quick-lru enforce a strict maxSize entry count?",
      "display": "Its target maxSize can be exceeded internally even though the reported size is capped.",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "FAQ: What happens when node-cache reaches maxKeys?",
      "display": "It throws and rejects a new entry instead of evicting an older entry.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Are TTL values measured in the same units?",
      "display": "node-cache uses seconds for ttl.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Are TTL values measured in the same units?",
      "display": "quick-lru maxAge uses milliseconds.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Are TTL values measured in the same units?",
      "display": "cache-manager ttl uses milliseconds.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Can lru-cache store undefined as a cached result?",
      "display": "No. Storing undefined removes the key. A sentinel value can stand in for an intentionally empty result.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Can lru-cache load a value asynchronously?",
      "display": "Its fetchMethod option supplies the asynchronous cache.fetch workflow.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: Does node-cache return the original stored object?",
      "display": "useClones defaults to true; disable it when shared mutable references are intended.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: Can cache-manager use Redis as another storage tier?",
      "display": "It supports Keyv storage adapters and demonstrates a separate Redis adapter alongside an in-memory tier.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: Does background refresh run without an expiry?",
      "display": "cache-manager does not trigger refresh when the key has no ttl.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "FAQ: Can serialized cache values change binary or special objects?",
      "display": "The cache-manager migration notes identify symbol and Uint8Array problems with default JSON serialization; configure Keyv serialization for those values.",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "FAQ: What does cache-manager return for a missing key?",
      "display": "The current v7 migration contract returns undefined rather than the earlier null result.",
      "asOf": "2026-11-17"
    },
    "F130": {
      "label": "FAQ: What changes with nonBlocking cache stores?",
      "display": "With nonBlocking enabled, cache-manager reads the first available store value, and writes without waiting for all stores.",
      "asOf": "2026-11-17"
    },
    "F131": {
      "label": "Library name, lru-cache",
      "display": "LRUCache",
      "asOf": "2026-11-20"
    },
    "F132": {
      "label": "Monthly downloads, lru-cache",
      "display": "3.1B",
      "asOf": "2026-11-20"
    },
    "F133": {
      "label": "License, lru-cache",
      "display": "BlueOak-1.0.0",
      "asOf": "2026-11-20"
    },
    "F134": {
      "label": "Package release, lru-cache",
      "display": "11.5.3",
      "asOf": "2026-11-20"
    },
    "F135": {
      "label": "Package release date, lru-cache",
      "display": "Sep 2026",
      "asOf": "2026-11-20"
    },
    "F136": {
      "label": "Install, lru-cache",
      "display": "npm install lru-cache@11.5.3",
      "asOf": "2026-11-20"
    },
    "F137": {
      "label": "Quickstart, lru-cache",
      "display": "import { LRUCache } from 'lru-cache';\n\nconst cache = new LRUCache({ max: 1000 });\ncache.set('key', 'value');\n",
      "asOf": "2026-11-20"
    },
    "F138": {
      "label": "LRU eviction, lru-cache",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F139": {
      "label": "Disk snapshots, lru-cache",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F140": {
      "label": "Async get/set, lru-cache",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F141": {
      "label": "Cache policy and operating model, lru-cache",
      "display": "Capacity-oriented in-memory LRU with count and weighted-size limits, optional per-entry TTL, disposal callbacks, and fetch-method support. Expired entries are not preemptively purged by default; TTL and capacity policies are separate.",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Project function, lru-cache",
      "display": "static fromUrl (giturl, opts) {\n  if (typeof giturl !== 'string') {\n    return\n  }\n\n  const key = giturl + JSON.stringify(opts || {})\n\n  if (!cache.has(key)) {\n    const hostArgs = fromUrl(giturl, opts, {\n      gitHosts: GitHost.#gitHosts,\n      protocols: GitHost.#protocols,\n    })\n    cache.set(key, hostArgs ? new GitHost(...hostArgs) : null)\n  }\n\n  return cache.get(key) ?? undefined\n}\n",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "Project source file, lru-cache",
      "display": "lib/index.js",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Project full_name, lru-cache",
      "display": "npm/hosted-git-info",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Project stargazers_count, lru-cache",
      "display": "240",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Library name, keyv",
      "display": "Keyv",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Monthly downloads, keyv",
      "display": "866.0M",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "License, keyv",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "Package release, keyv",
      "display": "6.1.0",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Package release date, keyv",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Install, keyv",
      "display": "npm install keyv@6.1.0",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Quickstart, keyv",
      "display": "import { Keyv } from 'keyv';\n\nconst cache = new Keyv();\nawait cache.set('key', 'value');\n",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Official description, keyv",
      "display": "Stores key-value pairs with namespaces and TTL behind an async API, in memory or through storage adapters.",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Quickstart source file, keyv",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "LRU eviction, keyv",
      "display": "Via plugin",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Disk snapshots, keyv",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Async get/set, keyv",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "Cache policy and operating model, keyv",
      "display": "Asynchronous key-value interface with namespaces and TTL, backed by an in-memory Map or external storage adapters. Own documentation shows QuickLRU integration for LRU; core does not itself become a remote database.",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Project function, keyv",
      "display": "const get = async (options_: any) => {\n\tawait Promise.resolve();\n\tconst cacheEntry = options_.cache\n\t\t? await this.cache.get(key)\n\t\t: undefined;\n\n\tif (cacheEntry === undefined && !options_.forceRefresh) {\n\t\tmakeRequest(options_);\n\t\treturn;\n\t}\n\n\tconst policy = CachePolicy.fromObject(\n\t\t(cacheEntry as CacheValue).cachePolicy,\n\t);\n\tif (\n\t\tpolicy.satisfiesWithoutRevalidation(options_) &&\n\t\t!options_.forceRefresh\n\t) {\n\t\tconst headers = convertHeaders(policy.responseHeaders());\n\t\tconst bodyBuffer = (cacheEntry as CacheValue).body;\n\t\tconst body = Buffer.from(bodyBuffer as string);\n\t\tconst response: any = new Response({\n\t\t\tstatusCode: (cacheEntry as CacheValue).statusCode,\n\t\t\theaders,\n\t\t\tbody,\n\t\t\turl: (cacheEntry as CacheValue).url,\n\t\t});\n\t\tresponse.cachePolicy = policy;\n\t\tresponse.fromCache = true;\n\t\tee.emit(\"response\", response);\n\t\tif (typeof callback === \"function\") {\n\t\t\tcallback(response);\n\t\t}\n\t} else if (\n\t\tpolicy.satisfiesWithoutRevalidation(options_) &&\n\t\tDate.now() >= policy.timeToLive() &&\n\t\toptions_.forceRefresh\n\t) {\n\t\tawait this.cache.delete(key);\n\t\toptions_.headers = policy.revalidationHeaders(options_);\n\t\tmakeRequest(options_);\n\t} else {\n\t\trevalidate = cacheEntry;\n\t\toptions_.headers = policy.revalidationHeaders(options_);\n\t\tmakeRequest(options_);\n\t}\n};\n",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Project source file, keyv",
      "display": "packages/cacheable-request/src/index.ts",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Project full_name, keyv",
      "display": "jaredwray/cacheable",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Project stargazers_count, keyv",
      "display": "2.0K",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Library name, flat-cache",
      "display": "FlatCache",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Monthly downloads, flat-cache",
      "display": "796.0M",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "License, flat-cache",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "Package release, flat-cache",
      "display": "6.1.23",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Package release date, flat-cache",
      "display": "Jun 2026",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Install, flat-cache",
      "display": "npm install flat-cache@6.1.23",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Quickstart, flat-cache",
      "display": "import { FlatCache } from 'flat-cache';\n\nconst cache = new FlatCache();\ncache.setKey('key', 'value');\ncache.save();\n",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Official description, flat-cache",
      "display": "Caches values in memory and saves them to a file, with TTL and LRU controls.",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Quickstart source file, flat-cache",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "LRU eviction, flat-cache",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Disk snapshots, flat-cache",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Async get/set, flat-cache",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "Cache policy and operating model, flat-cache",
      "display": "File-persisted value cache with a CacheableMemory layer, TTL/LRU controls, explicit load/save, and optional persistence intervals. Legacy getKey/setKey/removeKey aliases remain in current6, but save(true) now means force save, not prune.",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Project function, flat-cache",
      "display": "async getFromCache(key) {\n  const hashedKey = this.getCacheFilePath(key);\n  try {\n    if (this.cacheType === 'flat-cache') {\n      const cachedData = this.cacheInstance.getKey(hashedKey);\n      if (cachedData && cachedData.ttl && Date.now() > cachedData.ttl) {\n        this.cacheInstance.removeKey(hashedKey);\n        this.cacheInstance.save(true);\n        return null;\n      }\n      return cachedData ? cachedData.data : null;\n    } else if (this.cacheType === 'cache-manager') {\n      if (\n        typeof this.cacheInstance?.store?.get !== 'function' &&\n        typeof this.cacheInstance?.get !== 'function'\n      ) {\n        await this.loadCacheInstance();\n      }\n\n      if (typeof this.cacheInstance?.store?.get === 'function') {\n        return await this.cacheInstance.store.get(hashedKey);\n      } else if (typeof this.cacheInstance?.get === 'function') {\n        return await this.cacheInstance.get(hashedKey);\n      } else {\n        throw new CacheError('Cache manage not available');\n      }\n    } else if (this.cacheType === 'simple-cache') {\n      return await this.cacheInstance.getFromCache(hashedKey);\n    } else if (this.cacheType === 'memory-cache') {\n      return this.cacheInstance.get(hashedKey);\n    }\n  } catch (error) {\n    console.error(error);\n    return null;\n  }\n}\n",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Project source file, flat-cache",
      "display": "src/utils/cacheManager.js",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Project full_name, flat-cache",
      "display": "samestrin/llm-interface",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Project stargazers_count, flat-cache",
      "display": "123",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Library name, quick-lru",
      "display": "QuickLRU",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "Monthly downloads, quick-lru",
      "display": "238.8M",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "License, quick-lru",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Package release, quick-lru",
      "display": "8.0.0",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Package release date, quick-lru",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Install, quick-lru",
      "display": "npm install quick-lru@8.0.0",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Quickstart, quick-lru",
      "display": "import QuickLRU from 'quick-lru';\n\nconst cache = new QuickLRU({ maxSize: 1000 });\ncache.set('key', 'value');\n",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "LRU eviction, quick-lru",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Disk snapshots, quick-lru",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Async get/set, quick-lru",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "Cache policy and operating model, quick-lru",
      "display": "Small in-memory LRU map with entry-count maxSize, optional maxAge, and eviction callbacks. Its dual-map design can temporarily hold up to twice maxSize; that option is not a byte budget.",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Project function, quick-lru",
      "display": "function createLRUCache<T>(options: {maxSize: number}): SWRCache<T> {\n  const lru = new QuickLRU<string, {value: T}>(options)\n  return {\n    get(key: string) {\n      const entry = lru.get(key)\n      if (!entry) {\n        throw new Error(`Key not found in LRU cache: ${key}`)\n      }\n      return entry.value\n    },\n    set(key: string, value: T) {\n      lru.set(key, {value})\n    },\n    delete(key: string) {\n      lru.delete(key)\n    },\n    has(key: string) {\n      return lru.has(key)\n    },\n  }\n}\n",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Project source file, quick-lru",
      "display": "packages/sanity/src/core/util/rxSwr.ts",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Project full_name, quick-lru",
      "display": "sanity-io/sanity",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Project stargazers_count, quick-lru",
      "display": "6.4K",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Library name, cacheable",
      "display": "Cacheable",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "Monthly downloads, cacheable",
      "display": "161.0M",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "License, cacheable",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Package release, cacheable",
      "display": "2.5.0",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Package release date, cacheable",
      "display": "Jun 2026",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Install, cacheable",
      "display": "npm install cacheable@2.5.0",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Quickstart, cacheable",
      "display": "import { Cacheable } from 'cacheable';\n\nconst cache = new Cacheable();\nawait cache.set('key', 'value');\n",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Official description, cacheable",
      "display": "Coordinates a primary and a secondary cache built on Keyv, with TTL, tags, and statistics.",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Quickstart source file, cacheable",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "LRU eviction, cacheable",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "Disk snapshots, cacheable",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Async get/set, cacheable",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Cache policy and operating model, cacheable",
      "display": "Asynchronous primary/secondary cache coordination built around Keyv, with TTL, optional nonblocking secondary operations, stats, tags, and loader/memoization helpers. Nonblocking reads and failures have documented consistency tradeoffs.",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Project function, cacheable",
      "display": "public async handle(ctx: Context, url: URL, meta?: Meta, allowLazy?: boolean): Promise<UrlResult[]> {\n  const extractor = this.extractors.find(extractor => !isExtractorDisabled(ctx.config, extractor) && extractor.supports(ctx, url));\n  if (!extractor) {\n    return [];\n  }\n\n  const normalizedUrl = extractor.normalize(url);\n  const cacheKey = this.determineCacheKey(ctx, extractor, normalizedUrl);\n\n  const storedDataRaw = await this.urlResultCache.getRaw<UrlResult[]>(cacheKey);\n  const expires = storedDataRaw?.expires;\n  if (storedDataRaw && expires) {\n    const ttl = expires - Date.now();\n\n    /* istanbul ignore if */\n    if (ttl > 0) {\n      return (storedDataRaw.value as UrlResult[]).map(urlResult => ({ ...urlResult, ttl, url: new URL(urlResult.url) }));\n    }\n  }\n\n  const lazyUrlResults = await this.lazyUrlResultCache.get<UrlResult[]>(normalizedUrl.href) ?? [];\n\n  /* istanbul ignore next */\n  if (\n    lazyUrlResults.length && allowLazy && !extractor.viaMediaFlowProxy\n    && lazyUrlResults.every(urlResult => urlResult.format !== Format.hls) // related to Android issues, e.g. https://github.com/Stremio/stremio-bugs/issues/1574 or https://github.com/Stremio/stremio-bugs/issues/1579\n  ) {\n    // generate lazy extract urls\n    return lazyUrlResults.map((urlResult, index) => {\n      const extractUrl = new URL(`${envGet('PROTOCOL')}:${envGet('HOST')}/extract/`);\n\n      extractUrl.searchParams.set('index', `${index}`);\n      extractUrl.searchParams.set('url', url.href);\n\n      return { ...urlResult, url: extractUrl };\n    });\n  }\n\n  this.logger.info(`Extract ${url} using ${extractor.id} extractor`, ctx);\n\n  const mergedMeta: Meta = { ...meta, ...lazyUrlResults[0]?.meta };\n  const urlResults = await extractor.extract(ctx, normalizedUrl, { extractorId: extractor.id, ...mergedMeta });\n\n  if (!Object.keys(mergedMeta).length || urlResults.some(urlResult => urlResult.error)) {\n    await this.urlResultCache.delete(cacheKey);\n    await this.lazyUrlResultCache.delete(normalizedUrl.href);\n\n    return urlResults;\n  }\n\n  const ttl = urlResults.length ? extractor.ttl : 43200000; // 12h\n\n  await this.urlResultCache.set<UrlResult[]>(cacheKey, urlResults, ttl);\n\n  if (extractor.id !== 'external') {\n    await this.lazyUrlResultCache.set<UrlResult[]>(normalizedUrl.href, urlResults, 2629800000); // 1 month\n  }\n\n  return urlResults;\n};\n",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Project source file, cacheable",
      "display": "src/extractor/ExtractorRegistry.ts",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Project full_name, cacheable",
      "display": "webstreamr/webstreamr",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Project stargazers_count, cacheable",
      "display": "167",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Library name, @cacheable/memory",
      "display": "CacheableMemory",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "Monthly downloads, @cacheable/memory",
      "display": "158.3M",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "License, @cacheable/memory",
      "display": "MIT",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Package release, @cacheable/memory",
      "display": "2.2.0",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Package release date, @cacheable/memory",
      "display": "Jun 2026",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Install, @cacheable/memory",
      "display": "npm install @cacheable/memory@2.2.0",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "Quickstart, @cacheable/memory",
      "display": "import { CacheableMemory } from '@cacheable/memory';\n\nconst cache = new CacheableMemory();\ncache.set('key', 'value');\n",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Official description, @cacheable/memory",
      "display": "Keeps values in a synchronous in-memory store with an optional LRU size limit and TTL expiry.",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Quickstart source file, @cacheable/memory",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "LRU eviction, @cacheable/memory",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Disk snapshots, @cacheable/memory",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Async get/set, @cacheable/memory",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Cache policy and operating model, @cacheable/memory",
      "display": "Synchronous in-memory store with optional lruSize, TTL, lazy or interval expiry, cloning controls, raw metadata, and a Keyv adapter. LRU is disabled when lruSize is zero; map shard counts are not a byte limit.",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Project function, @cacheable/memory",
      "display": "public constructor(logger: winston.Logger, extractors: Extractor[]) {\n  this.logger = logger;\n  this.extractors = extractors;\n\n  this.urlResultCache = new Cacheable({\n    nonBlocking: true,\n    primary: new Keyv({ store: new CacheableMemory({ lruSize: 1024 }) }),\n    secondary: createKeyvSqlite('extractor-cache'),\n    stats: true,\n  });\n\n  this.lazyUrlResultCache = new Cacheable({\n    nonBlocking: true,\n    primary: new Keyv({ store: new CacheableMemory({ lruSize: 1024 }) }),\n    secondary: createKeyvSqlite('extractor-lazy-cache'),\n    stats: true,\n  });\n}\n",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "Project source file, @cacheable/memory",
      "display": "src/extractor/ExtractorRegistry.ts",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Project full_name, @cacheable/memory",
      "display": "webstreamr/webstreamr",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Project stargazers_count, @cacheable/memory",
      "display": "167",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Library name, @isaacs/ttlcache",
      "display": "TTLCache",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Monthly downloads, @isaacs/ttlcache",
      "display": "98.8M",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "License, @isaacs/ttlcache",
      "display": "BlueOak-1.0.0",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Package release, @isaacs/ttlcache",
      "display": "2.1.5",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Package release date, @isaacs/ttlcache",
      "display": "May 2026",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Install, @isaacs/ttlcache",
      "display": "npm install @isaacs/ttlcache@2.1.5",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "Quickstart, @isaacs/ttlcache",
      "display": "import { TTLCache } from '@isaacs/ttlcache';\n\nconst cache = new TTLCache({ max: 10000, ttl: 1000 });\ncache.set('key', 'value');\n",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Official description, @isaacs/ttlcache",
      "display": "Expires every entry after its TTL and evicts the soonest-expiring entries when the cache is full.",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Quickstart source file, @isaacs/ttlcache",
      "display": "README.md",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "LRU eviction, @isaacs/ttlcache",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Disk snapshots, @isaacs/ttlcache",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Async get/set, @isaacs/ttlcache",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Cache policy and operating model, @isaacs/ttlcache",
      "display": "Time-oriented cache whose capacity overflow evicts the soonest-expiring entries rather than the least recently used. Every entry requires a TTL; optional access refresh is explicit and weighted-size calculation is unsupported.",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best JavaScript caching libraries lru-cache quick-lru node-cache cache-manager code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
