OptionalcleanupIntervalMs?: numberHow often to clean up expired items (ms), default 5 minutes
OptionalmaxItems?: numberMaximum items to store before forcing cleanup, default 10000
OptionalautoCleanup?: booleanWhether to enable automatic cleanup, default true
Get a value by key
Storage key
Value or undefined if not found
Set a value with optional TTL
Storage key
Value to store
Optionalttl: numberTime to live in seconds (optional)
Delete a value by key
Storage key
Check if a key exists
Storage key
Clear all stored values (optional)
Get all keys (optional, for debugging)
Get storage size/count (optional, for monitoring)
Set multiple values at once
Delete multiple keys at once
Get keys matching a pattern
Delete keys matching a pattern
Manually trigger cleanup of expired items
Destroy the storage and cleanup resources
In-memory storage implementation with TTL support
This is the default storage used when no external storage is configured. Features:
Example