Create a cache with caller-defined weight accounting and optional entry limits.
Number of currently retained entries.
Return a new frozen snapshot of usage and limits.
Sum of currently retained entry weights.
Remove all entries and reset retained weight to zero.
Read and refresh an existing entry, including undefined, or synchronously create it. The factory receives the key and runs only on a miss, even when retention is disabled. Return the computed value whether or not it is admitted. Factory and insertion errors propagate; the factory must not mutate this cache. Promise values are stored as-is.
Live iterator, ordered least to most recently used.
LRU bounded by both entry count and caller-defined weight units.