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

iris-redis

v0.1.0

Published

Thin node_redis wrapper to connect to Iris Couch's Redis service

Downloads

11

Readme

Redis on Iris Couch

iris-redis is a very simple wrapper, 100% compatible with the Node.js redis package. It simplifies connecting, and helps to see metadata about your server.

Example

var redis = require('iris-redis')
var client = redis.createClient(6379, "redis.example.iriscouch.com")
client.auth("s3cret")

client.on("ready", function() {
  // Done! Hey, I said it was 100% compatible.
  client.iris_config(function(er, config) {
    if(er) throw er

    console.log("Got my server config: %j", config)
    client.quit()
  })
})

The output looks like this:

Got my server config:
{ '_config:datacenter': 'sj01.softlayer',
  '_config:server': 'example',
  '_config:max_memory': '20mb',
  '_config:ip': '10.55.80.194',
  '_config:port': '17162' }

Easy AUTH command

Iris Couch requires an AUTH command in the format redis.your_hostname.iriscouch.com:your_password. To save you some trouble, the iris-redis package prepends the hostname in its .auth() wrapper.

In other words, if you run this: client.auth("s3cret")

then iris-redis will convert that to this: client.auth("redis.example.iriscouch.com:s3cret")

Automatic authentication.

Since authentication is mandatory on Iris Couch, you can provide the "auth" key in the options.

var client = redis.createClient(6379, "redis.example.iriscouch.com", {auth: "s3cret"})

Upgrading to a direct connection

Iris Couch uses a reverse proxy—the same battle-hardened proxy that runs CouchDB. Unfortunately, this adds latency to Redis.

If you are in the right data center, you can connect directly to your server's IP address and port. The information is in the _config/* keys, or there is a convenience function.

client.iris_upgrade(function(er, new_client) {
  if(er) throw er

  // Hooray! This is a direct LAN connection to the back-end. Note, the original client already quit().
  new_client.set("happy", "true")
  new_client.quit()
})

License

Apache 2.0