redis-kv-store
TypeScript icon, indicating that this package has built-in type declarations

4.0.1 • Public • Published

redis-kv-store

A simple Redis based key/value store.

GitHub license Coverage Status

This simple project provides a key/value store based on Redis. It has the exact same API then the memory-kv-store module and relies on the redis-service module.

API

initRedisKV(services) ⇒ Promise.<RedisKVService>

Instantiate the Redis Key/Value service

Kind: global function
Returns: Promise.<RedisKVService> - A promise of the Redis Key Value service

Param Type Description
services Object The services to inject
services.redis function A simple-redis-service instance
services.log function A logging function

Example

import initRedisService from 'simple-redis-service';
import initRedisKV from 'redis-kv-store';

const redis = await initRedisService({
  REDIS: {
    host: 'localhost',
    port: 6379,
  },
  ENV: process.env,
  log: console.log.bind(console),
});
const redisKV = await initRedisKV({
  redis,
  log: console.log.bind(console),
});

const value = await redisKV.get('my_key');

Authors

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i redis-kv-store

Weekly Downloads

111

Version

4.0.1

License

MIT

Unpacked Size

24.8 kB

Total Files

12

Last publish

Collaborators

  • nfroidure