@kevinwang0316/redis-helper

1.0.1 • Public • Published

RedisHelper

A helper to generate asynchronous client for Redis.

Build Status Coverage Status

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.

Package Sidebar

Install

npm i @kevinwang0316/redis-helper

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

6.1 kB

Total Files

4

Last publish

Collaborators

  • kevinwang0316