npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

redibox

v2.3.0

Published

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

Downloads

36

Readme

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