redis-cluster-server
v1.2.2
Published
change import ts files
Downloads
45
Maintainers
Readme
redis-cluster-server ![NPM version](https://badge.fury.io/js/redis-cluster-server.png)
Redis Client to use cache for Cluster AWS or Server
Usage
import { RedisClient } from 'redis-cluster-server';
/** configure the Redis Client
*
* cluster_endpoint : define aws cluster or server
* cluster_port: port in use
* redis_pass: redis password
* is_cluster: if use cluster set true else set false
**/
const redisConnect = {
cluster_endpoint: 'localhost',
cluster_port : 6379,
redis_pass : 'password',
is_cluster: 'false',
}
const rc = new RedisClient(
redisConnect.cluster_endpoint,
redisConnect.cluster_port,
redisConnect.redis_pass,
redisConnect.is_cluster
);
//test of redis client server in localhost
const bootstrap = async () => {
//set information name as variable 'test'
await rc.set(
'test', //key
JSON.stringify({who: 'jose', name: 'test' }), //value
3600, //expiration
);
//get information of 'test'
const returnedCache = await rc.get(
'test' //key
);
console.log(returnedCache)
}
bootstrap()
Authors
Jose Rubilar
Licence
Copyright (c) 2023, Jose Rubilar. Released under the MIT license