/
astafievk
/
source_code
Обзор
Документация
Войти
/
astafievk
/
source_code
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
source_code
/
...
/
node_modules
/
lru-cache
/
..
dist
source code
2 года назад
LICENSE
source code
2 года назад
README.md
source code
2 года назад
package.json
source code
2 года назад
lru-cache
Installation
Usage
`class LRUCache(options)`
Options
`max` (read only)
`maxSize` (read only)
`maxEntrySize`
`sizeCalculation`
`fetchMethod` (read only)
`noDeleteOnFetchRejection`
`allowStaleOnFetchRejection`
`allowStaleOnFetchAbort`
`ignoreFetchAbort`
`dispose` (read only)
`disposeAfter` (read only)
`noDisposeOnSet`
`ttl`
`noUpdateTTL`
`ttlResolution`
`ttlAutopurge`
`allowStale`
`noDeleteOnStaleGet`
`updateAgeOnGet`
`updateAgeOnHas`
API
`new LRUCache(options)`
`cache.max`, `cache.maxSize`, `cache.allowStale`,
`cache.size`
`cache.calculatedSize`
`set(key, value, [{ size, sizeCalculation, ttl, noDisposeOnSet, start, status }])`
`get(key, { updateAgeOnGet, allowStale, status } = {}) => value`
`async fetch(key, options = {}) => Promise`
Setting `context`
Note: `fetch()` calls are inflight-unique
`peek(key, { allowStale } = {}) => value`
`has(key, { updateAgeOnHas, status } = {}) => Boolean`
`delete(key)`
`clear()`
`keys()`
`rkeys()`
`values()`
`rvalues()`
`entries()`
`rentries()`
`find(fn, [getOptions])`
`dump()`
`load(entries)`
`purgeStale()`
`getRemainingTTL(key)`
`forEach(fn, [thisp])`
`rforEach(fn, [thisp])`
`pop()`
Internal Methods and Properties
Status Tracking
Storage Bounds Safety
Performance
Breaking Changes in Version 7
Breaking Changes in Version 8
README.md