Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/velo/mod.ts>Policy

A high-performance caching library for Deno. Supports LRU, LFU, ARC, and TinyLFU.
Latest
interface Policy
import { type Policy } from "https://deno.land/x/velo@1.0.0/mod.ts";

Type Parameters

K extends Key
V

Properties

readonly
capacity: number
readonly
size: number
readonly
keys: K[]
readonly
values: V[]
optional
onEvict: RemoveListener<K, V>

Methods

set(key: K, value: V): V | undefined
get(key: K): V | undefined
peek(key: K): V | undefined
remove(key: K): V | undefined
clear(): void
has(key: K): boolean
forEach(callback: (item: { key: K; value: V; }, index: number) => void): void