import { LRUCache } from 'lru-cache'; class Cache { private static instance: LRUCache; private constructor() {} public static getInstance( max: number = 10000, maxAge: number = 1000 * 60 * 10, ): LRUCache { if (!Cache.instance) { const options = { max: max, length: () => 1, maxAge: maxAge, }; Cache.instance = new LRUCache(options); } return Cache.instance; } } export default Cache;