Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

redis-connection-pool

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-connection-pool

a redis client connection pool

  • 3.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
601
decreased by-68.18%
Maintainers
1
Weekly downloads
 
Created
Source

redis-connection-pool

A node.js connection pool for Redis.

Build Status license downloads

About

A high-level redis connection pooling object. It manages a number of connections in a pool, using them as needed and keeping all aspects of releasing active connections internal to the object.

Installation

npm install redis-connection-pool

Usage

import redisPoolFactory from 'redis-connection-pool';
const redisPool = await redisPoolFactory('myRedisPool', {
    max_clients: 5, // default
    redis: {
      url: 'redis://localhost:6379'
    }
  });


await redisPool.set('test-key', 'foobar');
const foo = await redisPool.get('test-key');
// returns 'foobar'

Or you can create a pool instance directly

import RedisConnectionPool from 'redis-connection-pool';
const redisPool = new RedisConnectionPool();
await redisPool.init();

When you are done

redisPool.shutdown();

Implemented Redis methods

  • del
  • blpop
  • brpop
  • brpoplpush
  • expire
  • get
  • hget
  • hgetall
  • hset
  • hdel
  • incr
  • lpush
  • rpush
  • set
  • sendCommand
  • ttl

Additional methods

  • init
  • shutdown

API Documentation

For the full documentation on the RedisConnectionPool class, see API.md.

License

MIT

Keywords

FAQs

Package last updated on 22 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc