Generic
TTL
Return the expiration in seconds of a key.
Arguments
keybodystringrequired
The key
Response
integerrequired
The number of seconds until this expires, negative if the key does not exist or does not have an expiration set.
Example
const seconds = await redis.ttl(key);