@brushy/storage uses node-cache-compatible TTL semantics. All internal expiry is tracked in milliseconds; public APIs accept seconds or human-readable strings.
Default TTL (stdTTL)
Set at construction time. Applied when set(key, value) omits a per-key TTL.
Per-key TTL on set
Duration units
Special values
ttl(key, ttl?)
Updates expiry of an existing key without changing the value. Returns false if the key is missing.
getTtl(key)
Returns the absolute expiry timestamp (Date.now() + remaining ms), 0 for non-expiring keys, or undefined if missing.
Background expiry (checkperiod)
A timer scans in-memory entries every checkperiod seconds (default 600). On Node.js the timer is unref()’d so it does not keep the process alive.
Set checkperiod: 0 to disable scans. Keys still expire lazily on get / has.