LRUCache

LRUCache

Simple LRU cache in memory, supports get,put,del operations only, TTL can be specified in milliseconds as future time

Constructor

new LRUCache(maxopt)

Source:
Parameters:
Name Type Attributes Default Description
max number <optional>
10000

max number of items in the cache

Example
const { lib } = require("backendjs")

const lru = new lib.LRUCache(1000)

Members

map :Map

Description:
  • Map to hold items

Source:

max :number

Description:
  • Max items to keep in the map

Source: