Package Exports
- redis-connection-pool
- redis-connection-pool/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (redis-connection-pool) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
node-redis-connection-pool
A node.js connection pool for Redis.
About
node-redis-connection-pool is a high-level redis management 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, so the user does not need to worry about forgotten connections leaking resources.
NOTE Version 2.x is a rewrite and not backward compatible, please re-read the documentation to update your code.
Installation
npm install redis-connection-pool
Usage
var redisPool = require('redis-connection-pool')('myRedisPool', {
max_clients: 10, // defalut
redis: {
host: '127.0.0.1',
port: 6379
}
});
redisPool.init();
await redisPool.set('test-key', 'foobar');
Implemented methods
- get
get(key)
- set
set(key, value, ttl)
- expire
expire(key, value)
- del
del(key)
- hget
hget(key, field)
- hgetall
hgetall(key)
- hset
hset(key, field, value)
- hdel
hdel(key, [fields])
- brpop
brpop(key)
- brpoplpush
brpoplpush(key1, key2)
- blpop
blpop(key)
- rpush
rpush(key, value)
- lpush
lpush(key, value)
API Documentation
node-redis-connection-pool uses jsdoc-to-markdown to generate the API.md from the source code.