Skip to content
Node: lru-cache2 APIs

cache

Package cache provides an in-memory LRU cache with optional TTL per entry, similar to node-cache and lru-cache in Node.js. Node equivalent: node-cache, lru-cache

import "github.com/sahilkhaire/gox/cache"
## API reference

Select a symbol below — each page explains what it does, shows Node.js vs Go comparisons, and includes a runnable example.

Types

SymbolNode.jsKindSummary
CachetypeCache is a thread-safe LRU cache with per-key TTL.

Methods

SymbolNode.jsKindSummary
Cache.Newnew LRUCache({ max })methodNew creates a cache that evicts least-recently-used entries when size exceeds maxSize.

MIT Licensed · Built for Node.js developers moving to Go