Wrapper

Wrapper

Base class for all the data wrappers in Redis

Constructor

new Wrapper(client, key, useJSONopt)

Construct base class and all it's children with bound client

Parameters:
Name Type Attributes Default Description
client Object

Client to provide all the operations

key String

Name of the key under which the Redis structure is stored

useJSON Boolean <optional>
false

Whether information in this structure should be stored as JSON

Source:

Methods

prom(method) → {function}

Return promisified version of Redis client's methods.

Uses util.promisify internally which is most native way of getting Promise. As all Redis commands have name of the key as first argument, we can and do set first argument with name/key of the storage/structure

Parameters:
Name Type Description
method String

Method to return promisified

Source:

clear() → {Promise}

Remove any data type from global scope using DEL method and the key used in creation

Command might be used for debug clean-up, development purposes or for production reset of the storage

Source: