TTL Set
JSON →The `ttl-set` package provides a JavaScript `Set`-like data structure where each entry automatically expires after a specified time-to-live (TTL). It is currently at version 1.0.0, indicating a stable API with a well-defined feature set. The library's release cadence is likely infrequent due to its focused and stable utility functionality, serving as a robust solution for simple, time-bound caching needs. Its primary differentiator is the direct integration of TTL expiration into the `Set` interface, distinguishing it from general-purpose `Set` objects or more complex caching libraries that might offer LRU/LFU policies. This makes it ideal for scenarios requiring a basic, memory-efficient, and self-cleaning collection of unique values, such as tracking active sessions, recently seen items, or implementing basic rate-limiting without external dependencies or elaborate configuration. The core API mirrors `Set.prototype`, offering `add`, `has`, `clear`, and `size`.
Traffic · last 30 days ↓14% vs prev 7d
top countries 🇺🇸 United States · 🇨🇦 Canada · 🇩🇪 Germany · 🇫🇷 France