@kevinwang0316/redis-helper
v1.0.1
Published
A helper to generate asynchronous clients for Redis.
Downloads
5
Maintainers
Readme
RedisHelper
A helper to generate asynchronous client for Redis.
Installing
npm install --save @kevinwang0316/redis-helper
Usage
// Node
const { createClient, getAsync, setAsync, quit, getClient } = require('@kevinwang0316/redis-helper');
// ES6
//import { createClient, getAsync, setAsync, quit, getClient } from '@kevinwang0316/redis-helper';
// Initialize the client before you use other functions
createClient('host', 'port', 'password');
// Set values
await setAsync('key', 'value');
// Get values
const value = await getAsync('key');
// Get Redis client
const client = getClient();
// Quit client
quit();
License
RedisHelper is licensed under MIT License - see the License file.