Skip to main content

redis.js

Classes#

Redis

Functions#

getAsync(key) โ‡’ Promise.<string>

Gets a string from the redis cache by key

setAsync(key, value) โ‡’ Promise.<void>

Sets a value with the provided key

delAsync(key) โ‡’ Promise.<void>

Deletes the entry with the specific key

expireAsync(key, time) โ‡’ Promise.<void>

Set's a key's expiration

getNumberAsync(key) โ‡’ Promise.<(number|null)>

Gets a number from the redis cache by key

Redis#

Kind: global class

new Redis()#

Creates a Redis class

getAsync(key) โ‡’ Promise.<string>#

Gets a string from the redis cache by key

Kind: global function
Returns: Promise.<string> -

The value

ParamTypeDescription
keystring

The key

setAsync(key, value) โ‡’ Promise.<void>#

Sets a value with the provided key

Kind: global function

ParamTypeDescription
keystring

The key

valuestring

The value

delAsync(key) โ‡’ Promise.<void>#

Deletes the entry with the specific key

Kind: global function

ParamTypeDescription
keystring

The key

expireAsync(key, time) โ‡’ Promise.<void>#

Set's a key's expiration

Kind: global function

ParamTypeDescription
keystring

The key

timenumber

Time until the key should expire, in seconds

getNumberAsync(key) โ‡’ Promise.<(number|null)>#

Gets a number from the redis cache by key

Kind: global function
Returns: Promise.<(number|null)> -

The value or null if there is no number

ParamTypeDescription
keystring

The key