2.3.0 • Published 8 years ago

redibox v2.3.0

Weekly downloads
7
License
MIT
Repository
github
Last release
8 years ago

RediBox

Coverage Status Downloads npm version dependencies build License

Redis connection and PUBSUB subscription manager for node. Built for performance, powered by ioredis (for now).

What can you do with RediBox?

RediBox offers out of the box support for clusters, sentinels and standalone redis servers. It also provides easy utilities around redis client connection monitoring, scaling cluster reads with READONLY, advanced subscriptions via PUBSUB (in the easy to use node.js Event Emitter format), lua script management and executing commands against a cluster.

RediBox is also easily extensible via Hooks.

Getting Started

Install via npm:

npm install redibox --save

And include in your project:

// ES6
import Redibox from 'redibox';

const RediBox = new Redibox({
  redis: {
    port: 7777
  }
}); // optional callback for bootstrap ready status or use events:

RediBox.on('ready' clientStatus => {
  RediBox.log.info(clientStatus); // internal redibox instance of winston if needed.
  // use cache module to set a cached value with a 60 second validity time.
  RediBox.hooks.cache.set('myKey', 'myVal', 60); // use a callback or a promise
});

RediBox.on('error' error => {
  RediBox.log.error(error); // internal redibox instance of winston if needed.
});

For an example of connecting to a cluster see the Cluster Hook documentation.

Configuration

See the default config for all available configuration options.

Documentation

Hooks

RediBox has a built in hook loading system and has plenty of published hook modules that support many of the common Redis use cases and provide additional functionality.

RediBox Hooks

  • Cache - Redis as a cache layer made simple.
  • Job - High performance, robust and flexible queue/worker system powered by redis.
  • Memset - Synchronised data sets stored in memory across all servers - for quick synchronous access to data that is commonly used but not likely to update frequently.
  • Schedule - Cross server task scheduling made easy.
  • Throttle - Provides lua scripts to throttle things, i.e. 100 inbound http reqs per user every 10secs
  • Trend - Track trending data with Node - using Bitly Forget-Table type data structures.

Public User Hooks

  • None

If you would like to publish your own hook and list it here see the extending functionality via Hooks documentation, once published submit a PR to list it on the readme here.

Contributing

Full contributing guidelines are to be written, however please ensure you follow these points when sending in PRs:

  • Ensure no lint warnings occur via npm run lint.
  • Implement tests for new features / functionality.
  • Ensure coverage remains above 80% and does not decrease.
  • Use debug logging throughout for ease of debugging issues, see core.js for example.
  • New modules should follow the same format as the default modules / template.

Note: For debugging purposes you may want to enable verbose logging via the config:

  new RediBox({
    log: {
      level: 'verbose'
    }
  });

License

MIT

2.3.0

8 years ago

2.2.3

8 years ago

2.2.2

8 years ago

2.2.1

8 years ago

2.1.0

8 years ago

2.0.8

8 years ago

2.0.7

8 years ago

2.0.6

8 years ago

2.0.5

8 years ago

2.0.4

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

0.1.13

8 years ago

0.1.12

8 years ago

0.1.11

8 years ago

0.1.10

8 years ago

0.1.9

8 years ago

0.1.8

8 years ago

0.1.7

8 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago