Skip to content

Instantly share code, notes, and snippets.

@Fabryz
Created June 17, 2013 09:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Fabryz/5795660 to your computer and use it in GitHub Desktop.
Save Fabryz/5795660 to your computer and use it in GitHub Desktop.
npm install redis error
0 info it worked if it ends with ok
1 verbose cli [ 'node', '/usr/local/bin/npm', 'install', 'redis', '--save' ]
2 info using npm@1.2.21
3 info using node@v0.8.23
4 verbose read json /Applications/MAMP/htdocs/node-redis-test/package.json
5 warn package.json node-redis-test@0.0.0 No repository field.
6 warn package.json node-redis-test@0.0.0 No readme data.
7 verbose read json /Applications/MAMP/htdocs/node-redis-test/node_modules/redis/package.json
8 verbose from cache /Applications/MAMP/htdocs/node-redis-test/package.json
9 verbose readDependencies using package.json deps
10 verbose cache add [ 'redis', null ]
11 verbose cache add name=undefined spec="redis" args=["redis",null]
12 verbose parsed url { pathname: 'redis', path: 'redis', href: 'redis' }
13 silly lockFile b840fc02-redis redis
14 verbose lock redis /Users/fcodello/.npm/b840fc02-redis.lock
15 silly lockFile b840fc02-redis redis
16 silly lockFile b840fc02-redis redis
17 verbose addNamed [ 'redis', '' ]
18 verbose addNamed [ null, '' ]
19 silly lockFile fb3bbc27-redis redis@
20 verbose lock redis@ /Users/fcodello/.npm/fb3bbc27-redis.lock
21 silly addNameRange { name: 'redis', range: '', hasData: false }
22 verbose url raw redis
23 verbose url resolving [ 'https://registry.npmjs.org/', './redis' ]
24 verbose url resolved https://registry.npmjs.org/redis
25 info trying registry request attempt 1 at 11:08:27
26 verbose etag "2L6QS0MDD04X37PB81VVL0EF9"
27 http GET https://registry.npmjs.org/redis
28 http 304 https://registry.npmjs.org/redis
29 silly registry.get cb [ 304,
29 silly registry.get { server: 'CouchDB/1.3.0 (Erlang OTP/R15B03)',
29 silly registry.get etag: '"2L6QS0MDD04X37PB81VVL0EF9"',
29 silly registry.get date: 'Mon, 17 Jun 2013 09:08:28 GMT',
29 silly registry.get 'content-length': '0' } ]
30 verbose etag redis from cache
31 silly addNameRange number 2 { name: 'redis', range: '', hasData: true }
32 silly addNameRange versions [ 'redis',
32 silly addNameRange [ '0.0.1',
32 silly addNameRange '0.0.2',
32 silly addNameRange '0.0.3',
32 silly addNameRange '0.0.4',
32 silly addNameRange '0.0.7',
32 silly addNameRange '0.0.8',
32 silly addNameRange '0.1.0',
32 silly addNameRange '0.1.1',
32 silly addNameRange '0.1.2',
32 silly addNameRange '0.2.0',
32 silly addNameRange '0.2.1',
32 silly addNameRange '0.2.2',
32 silly addNameRange '0.2.3',
32 silly addNameRange '0.2.4',
32 silly addNameRange '0.2.6',
32 silly addNameRange '0.3.0',
32 silly addNameRange '0.3.1',
32 silly addNameRange '0.3.2',
32 silly addNameRange '0.3.3',
32 silly addNameRange '0.3.4',
32 silly addNameRange '0.3.5',
32 silly addNameRange '0.3.6',
32 silly addNameRange '0.3.7',
32 silly addNameRange '0.3.9',
32 silly addNameRange '0.4.0',
32 silly addNameRange '0.4.1',
32 silly addNameRange '0.4.2',
32 silly addNameRange '0.5.0',
32 silly addNameRange '0.5.1',
32 silly addNameRange '0.5.2',
32 silly addNameRange '0.5.3',
32 silly addNameRange '0.5.4',
32 silly addNameRange '0.5.5',
32 silly addNameRange '0.5.6',
32 silly addNameRange '0.5.7',
32 silly addNameRange '0.5.8',
32 silly addNameRange '0.5.9',
32 silly addNameRange '0.5.10',
32 silly addNameRange '0.5.11',
32 silly addNameRange '0.6.0',
32 silly addNameRange '0.6.1',
32 silly addNameRange '0.6.2',
32 silly addNameRange '0.6.3',
32 silly addNameRange '0.6.4',
32 silly addNameRange '0.6.5',
32 silly addNameRange '0.6.6',
32 silly addNameRange '0.6.7',
32 silly addNameRange '0.7.0',
32 silly addNameRange '0.7.1',
32 silly addNameRange '0.7.2',
32 silly addNameRange '0.7.3',
32 silly addNameRange '0.8.0',
32 silly addNameRange '0.8.1',
32 silly addNameRange '0.8.2',
32 silly addNameRange '0.8.3' ] ]
33 verbose addNamed [ 'redis', '0.8.3' ]
34 verbose addNamed [ '0.8.3', '0.8.3' ]
35 silly lockFile 3ea236b3-redis-0-8-3 redis@0.8.3
36 verbose lock redis@0.8.3 /Users/fcodello/.npm/3ea236b3-redis-0-8-3.lock
37 verbose read json /Users/fcodello/.npm/redis/0.8.3/package/package.json
38 silly lockFile 3ea236b3-redis-0-8-3 redis@0.8.3
39 silly lockFile 3ea236b3-redis-0-8-3 redis@0.8.3
40 silly lockFile fb3bbc27-redis redis@
41 silly lockFile fb3bbc27-redis redis@
42 silly resolved [ { name: 'redis',
42 silly resolved version: '0.8.3',
42 silly resolved description: 'Redis client library',
42 silly resolved keywords: [ 'redis', 'database' ],
42 silly resolved author: { name: 'Matt Ranney', email: 'mjr@ranney.com' },
42 silly resolved main: './index.js',
42 silly resolved scripts: { test: 'node ./test.js' },
42 silly resolved devDependencies: { metrics: '>=0.1.5', colors: '~0.6.0-1', underscore: '~1.4.4' },
42 silly resolved repository: { type: 'git', url: 'git://github.com/mranney/node_redis.git' },
42 silly resolved readme: 'redis - a node.js redis client\n===========================\n\nThis is a complete Redis client for node.js. It supports all Redis commands, including many recently added commands like EVAL from\nexperimental Redis server branches.\n\n\nInstall with:\n\n npm install redis\n\nPieter Noordhuis has provided a binding to the official `hiredis` C library, which is non-blocking and fast. To use `hiredis`, do:\n\n npm install hiredis redis\n\nIf `hiredis` is installed, `node_redis` will use it by default. Otherwise, a pure JavaScript parser will be used.\n\nIf you use `hiredis`, be sure to rebuild it whenever you upgrade your version of node. There are mysterious failures that can\nhappen between node and native code modules after a node upgrade.\n\n\n## Usage\n\nSimple example, included as `examples/simple.js`:\n\n```js\n var redis = require("redis"),\n client = redis.createClient();\n\n // if you\'d like to select database 3, instead of 0 (default), call\n // client.select(3, function() { /* ... */ });\n\n client.on("error", function (err) {\n console.log("Error " + err);\n });\n\n client.set("string key", "string val", redis.print);\n client.hset("hash key", "hashtest 1", "some value", redis.print);\n client.hset(["hash key", "hashtest 2", "some other value"], redis.print);\n client.hkeys("hash key", function (err, replies) {\n console.log(replies.length + " replies:");\n replies.forEach(function (reply, i) {\n console.log(" " + i + ": " + reply);\n });\n client.quit();\n });\n```\n\nThis will display:\n\n mjr:~/work/node_redis (master)$ node example.js\n Reply: OK\n Reply: 0\n Reply: 0\n 2 replies:\n 0: hashtest 1\n 1: hashtest 2\n mjr:~/work/node_redis (master)$\n\n\n## Performance\n\nHere are typical results of `multi_bench.js` which is similar to `redis-benchmark` from the Redis distribution.\nIt uses 50 concurrent connections with no pipelining.\n\nJavaScript parser:\n\n PING: 20000 ops 42283.30 ops/sec 0/5/1.182\n SET: 20000 ops 32948.93 ops/sec 1/7/1.515\n GET: 20000 ops 28694.40 ops/sec 0/9/1.740\n INCR: 20000 ops 39370.08 ops/sec 0/8/1.269\n LPUSH: 20000 ops 36429.87 ops/sec 0/8/1.370\n LRANGE (10 elements): 20000 ops 9891.20 ops/sec 1/9/5.048\n LRANGE (100 elements): 20000 ops 1384.56 ops/sec 10/91/36.072\n\nhiredis parser:\n\n PING: 20000 ops 46189.38 ops/sec 1/4/1.082\n SET: 20000 ops 41237.11 ops/sec 0/6/1.210\n GET: 20000 ops 39682.54 ops/sec 1/7/1.257\n INCR: 20000 ops 40080.16 ops/sec 0/8/1.242\n LPUSH: 20000 ops 41152.26 ops/sec 0/3/1.212\n LRANGE (10 elements): 20000 ops 36563.07 ops/sec 1/8/1.363\n LRANGE (100 elements): 20000 ops 21834.06 ops/sec 0/9/2.287\n\nThe performance of `node_redis` improves dramatically with pipelining, which happens automatically in most normal programs.\n\n\n### Sending Commands\n\nEach Redis command is exposed as a function on the `client` object.\nAll functions take either an `args` Array plus optional `callback` Function or\na variable number of individual arguments followed by an optional callback.\nHere is an example of passing an array of arguments and a callback:\n\n client.mset(["test keys 1", "test val 1", "test keys 2", "test val 2"], function (err, res) {});\n\nHere is that same call in the second style:\n\n client.mset("test keys 1", "test val 1", "test keys 2", "test val 2", function (err, res) {});\n\nNote that in either form the `callback` is optional:\n\n client.set("some key", "some val");\n client.set(["some other key", "some val"]);\n\nIf the key is missing, reply will be null (probably):\n\n client.get("missingkey", function(err, reply) {\n // reply is null when the key is missing\n console.log(reply);\n });\n\nFor a list of Redis commands, see [Redis Command Reference](http://redis.io/commands)\n\nThe commands can be specified in uppercase or lowercase for convenience. `client.get()` is the same as `client.GET()`.\n\nMinimal parsing is done on the replies. Commands that return a single line reply return JavaScript Strings,\ninteger replies return JavaScript Numbers, "bulk" replies return node Buffers, and "multi bulk" replies return a\nJavaScript Array of node Buffers. `HGETALL` returns an Object with Buffers keyed by the hash keys.\n\n# API\n\n## Connection Events\n\n`client` will emit some events about the state of the connection to the Redis server.\n\n### "ready"\n\n`client` will emit `ready` a connection is established to the Redis server and the server reports\nthat it is ready to receive commands. Commands issued before the `ready` event are queued,\nthen replayed just before this event is emitted.\n\n### "connect"\n\n`client` will emit `connect` at the same time as it emits `ready` unless `client.options.no_ready_check`\nis set. If this options is set, `connect` will be emitted when the stream is connected, and then\nyou are free to try to send commands.\n\n### "error"\n\n`client` will emit `error` when encountering an error connecting to the Redis server.\n\nNote that "error" is a special event type in node. If there are no listeners for an\n"error" event, node will exit. This is usually what you want, but it can lead to some\ncryptic error messages like this:\n\n mjr:~/work/node_redis (master)$ node example.js\n\n node.js:50\n throw e;\n ^\n Error: ECONNREFUSED, Connection refused\n at IOWatcher.callback (net:870:22)\n at node.js:607:9\n\nNot very useful in diagnosing the problem, but if your program isn\'t ready to handle this,\nit is probably the right thing to just exit.\n\n`client` will also emit `error` if an exception is thrown inside of `node_redis` for whatever reason.\nIt would be nice to distinguish these two cases.\n\n### "end"\n\n`client` will emit `end` when an established Redis server connection has closed.\n\n### "drain"\n\n`client` will emit `drain` when the TCP connection to the Redis server has been buffering, but is now\nwritable. This event can be used to stream commands in to Redis and adapt to backpressure. Right now,\nyou need to check `client.command_queue.length` to decide when to reduce your send rate. Then you can\nresume sending when you get `drain`.\n\n### "idle"\n\n`client` will emit `idle` when there are no outstanding commands that are awaiting a response.\n\n## redis.createClient(port, host, options)\n\nCreate a new client connection. `port` defaults to `6379` and `host` defaults\nto `127.0.0.1`. If you have `redis-server` running on the same computer as node, then the defaults for\nport and host are probably fine. `options` in an object with the following possible properties:\n\n* `parser`: which Redis protocol reply parser to use. Defaults to `hiredis` if that module is installed.\nThis may also be set to `javascript`.\n* `return_buffers`: defaults to `false`. If set to `true`, then all replies will be sent to callbacks as node Buffer\nobjects instead of JavaScript Strings.\n* `detect_buffers`: default to `false`. If set to `true`, then replies will be sent to callbacks as node Buffer objects\nif any of the input arguments to the original command were Buffer objects.\nThis option lets you switch between Buffers and Strings on a per-command basis, whereas `return_buffers` applies to\nevery command on a client.\n* `socket_nodelay`: defaults to `true`. Whether to call setNoDelay() on the TCP stream, which disables the\nNagle algorithm on the underlying socket. Setting this option to `false` can result in additional throughput at the\ncost of more latency. Most applications will want this set to `true`.\n* `no_ready_check`: defaults to `false`. When a connection is established to the Redis server, the server might still\nbe loading the database from disk. While loading, the server not respond to any commands. To work around this,\n`node_redis` has a "ready check" which sends the `INFO` command to the server. The response from the `INFO` command\nindicates whether the server is ready for more commands. When ready, `node_redis` emits a `ready` event.\nSetting `no_ready_check` to `true` will inhibit this check.\n* `enable_offline_queue`: defaults to `true`. By default, if there is no active\nconnection to the redis server, commands are added to a queue and are executed\nonce the connection has been established. Setting `enable_offline_queue` to\n`false` will disable this feature and the callback will be execute immediately\nwith an error, or an error will be thrown if no callback is specified.\n* `retry_max_delay`: defaults to `null`. By default every time the client tries to connect and fails time before\nreconnection (delay) almost doubles. This delay normally grows infinitely, but setting `retry_max_delay` limits delay\nto maximum value, provided in milliseconds.\n* `connect_timeout` defaults to `false`. By default client will try reconnecting until connected. Setting `connect_timeout`\nlimits total time for client to reconnect. Value is provided in milliseconds and is counted once the disconnect occured.\n* `max_attempts` defaults to `null`. By default client will try reconnecting until connected. Setting `max_attempts`\nlimits total amount of reconnects.\n\n```js\n var redis = require("redis"),\n client = redis.createClient(null, null, {detect_buffers: true});\n\n client.set("foo_rand000000000000", "OK");\n\n // This will return a JavaScript String\n client.get("foo_rand000000000000", function (err, reply) {\n console.log(reply.toString()); // Will print `OK`\n });\n\n // This will return a Buffer since original key is specified as a Buffer\n client.get(new Buffer("foo_rand000000000000"), function (err, reply) {\n console.log(reply.toString()); // Will print `<Buffer 4f 4b>`\n });\n client.end();\n```\n\n`createClient()` returns a `RedisClient` object that is named `client` in all of the examples here.\n\n## client.auth(password, callback)\n\nWhen connecting to Redis servers that require authentication, the `AUTH` command must be sent as the\nfirst command after connecting. This can be tricky to coordinate with reconnections, the ready check,\netc. To make this easier, `client.auth()` stashes `password` and will send it after each connection,\nincluding reconnections. `callback` is invoked only once, after the response to the very first\n`AUTH` command sent.\nNOTE: Your call to `client.auth()` should not be inside the ready handler. If\nyou are doing this wrong, `client` will emit an error that looks\nsomething like this `Error: Ready check failed: ERR operation not permitted`.\n\n## client.end()\n\nForcibly close the connection to the Redis server. Note that this does not wait until all replies have been parsed.\nIf you want to exit cleanly, call `client.quit()` to send the `QUIT` command after you have handled all replies.\n\nThis example closes the connection to the Redis server before the replies have been read. You probably don\'t\nwant to do this:\n\n```js\n var redis = require("redis"),\n client = redis.createClient();\n\n client.set("foo_rand000000000000", "some fantastic value");\n client.get("foo_rand000000000000", function (err, reply) {\n console.log(reply.toString());\n });\n client.end();\n```\n\n`client.end()` is useful for timeout cases where something is stuck or taking too long and you want\nto start over.\n\n## Friendlier hash commands\n\nMost Redis commands take a single String or an Array of Strings as arguments, and replies are sent back as a single String or an Array of Strings.\nWhen dealing with hash values, there are a couple of useful exceptions to this.\n\n### client.hgetall(hash)\n\nThe reply from an HGETALL command will be converted into a JavaScript Object by `node_redis`. That way you can interact\nwith the responses using JavaScript syntax.\n\nExample:\n\n client.hmset("hosts", "mjr", "1", "another", "23", "home", "1234");\n client.hgetall("hosts", function (err, obj) {\n console.dir(obj);\n });\n\nOutput:\n\n { mjr: \'1\', another: \'23\', home: \'1234\' }\n\n### client.hmset(hash, obj, [callback])\n\nMultiple values in a hash can be set by supplying an object:\n\n client.HMSET(key2, {\n "0123456789": "abcdefghij", // NOTE: key and value will be coerced to strings\n "some manner of key": "a type of value"\n });\n\nThe properties and values of this Object will be set as keys and values in the Redis hash.\n\n### client.hmset(hash, key1, val1, ... keyn, valn, [callback])\n\nMultiple values may also be set by supplying a list:\n\n client.HMSET(key1, "0123456789", "abcdefghij", "some manner of key", "a type of value");\n\n\n## Publish / Subscribe\n\nHere is a simple example of the API for publish / subscribe. This program opens two\nclient connections, subscribes to a channel on one of them, and publishes to that\nchannel on the other:\n\n```js\n var redis = require("redis"),\n client1 = redis.createClient(), client2 = redis.createClient(),\n msg_count = 0;\n\n client1.on("subscribe", function (channel, count) {\n client2.publish("a nice channel", "I am sending a message.");\n client2.publish("a nice channel", "I am sending a second message.");\n client2.publish("a nice channel", "I am sending my last message.");\n });\n\n client1.on("message", function (channel, message) {\n console.log("client1 channel " + channel + ": " + message);\n msg_count += 1;\n if (msg_count === 3) {\n client1.unsubscribe();\n client1.end();\n client2.end();\n }\n });\n\n client1.incr("did a thing");\n client1.subscribe("a nice channel");\n```\n\nWhen a client issues a `SUBSCRIBE` or `PSUBSCRIBE`, that connection is put into "pub/sub" mode.\nAt that point, only commands that modify the subscription set are valid. When the subscription\nset is empty, the connection is put back into regular mode.\n\nIf you need to send regular commands to Redis while in pub/sub mode, just open another connection.\n\n## Pub / Sub Events\n\nIf a client has subscriptions active, it may emit these events:\n\n### "message" (channel, message)\n\nClient will emit `message` for every message received that matches an active subscription.\nListeners are passed the channel name as `channel` and the message Buffer as `message`.\n\n### "pmessage" (pattern, channel, message)\n\nClient will emit `pmessage` for every message received that matches an active subscription pattern.\nListeners are passed the original pattern used with `PSUBSCRIBE` as `pattern`, the sending channel\nname as `channel`, and the message Buffer as `message`.\n\n### "subscribe" (channel, count)\n\nClient will emit `subscribe` in response to a `SUBSCRIBE` command. Listeners are passed the\nchannel name as `channel` and the new count of subscriptions for this client as `count`.\n\n### "psubscribe" (pattern, count)\n\nClient will emit `psubscribe` in response to a `PSUBSCRIBE` command. Listeners are passed the\noriginal pattern as `pattern`, and the new count of subscriptions for this client as `count`.\n\n### "unsubscribe" (channel, count)\n\nClient will emit `unsubscribe` in response to a `UNSUBSCRIBE` command. Listeners are passed the\nchannel name as `channel` and the new count of subscriptions for this client as `count`. When\n`count` is 0, this client has left pub/sub mode and no more pub/sub events will be emitted.\n\n### "punsubscribe" (pattern, count)\n\nClient will emit `punsubscribe` in response to a `PUNSUBSCRIBE` command. Listeners are passed the\nchannel name as `channel` and the new count of subscriptions for this client as `count`. When\n`count` is 0, this client has left pub/sub mode and no more pub/sub events will be emitted.\n\n## client.multi([commands])\n\n`MULTI` commands are queued up until an `EXEC` is issued, and then all commands are run atomically by\nRedis. The interface in `node_redis` is to return an individual `Multi` object by calling `client.multi()`.\n\n```js\n var redis = require("./index"),\n client = redis.createClient(), set_size = 20;\n\n client.sadd("bigset", "a member");\n client.sadd("bigset", "another member");\n\n while (set_size > 0) {\n client.sadd("bigset", "member " + set_size);\n set_size -= 1;\n }\n\n // multi chain with an individual callback\n client.multi()\n .scard("bigset")\n .smembers("bigset")\n .keys("*", function (err, replies) {\n // NOTE: code in this callback is NOT atomic\n // this only happens after the the .exec call finishes.\n client.mget(replies, redis.print);\n })\n .dbsize()\n .exec(function (err, replies) {\n console.log("MULTI got " + replies.length + " replies");\n replies.forEach(function (reply, index) {\n console.log("Reply " + index + ": " + reply.toString());\n });\n });\n```\n\n`client.multi()` is a constructor that returns a `Multi` object. `Multi` objects share all of the\nsame command methods as `client` objects do. Commands are queued up inside the `Multi` object\nuntil `Multi.exec()` is invoked.\n\nYou can either chain together `MULTI` commands as in the above example, or you can queue individual\ncommands while still sending regular client command as in this example:\n\n```js\n var redis = require("redis"),\n client = redis.createClient(), multi;\n\n // start a separate multi command queue\n multi = client.multi();\n multi.incr("incr thing", redis.print);\n multi.incr("incr other thing", redis.print);\n\n // runs immediately\n client.mset("incr thing", 100, "incr other thing", 1, redis.print);\n\n // drains multi queue and runs atomically\n multi.exec(function (err, replies) {\n console.log(replies); // 101, 2\n });\n\n // you can re-run the same transaction if you like\n multi.exec(function (err, replies) {\n console.log(replies); // 102, 3\n client.quit();\n });\n```\n\nIn addition to adding commands to the `MULTI` queue individually, you can also pass an array\nof commands and arguments to the constructor:\n\n```js\n var redis = require("redis"),\n client = redis.createClient(), multi;\n\n client.multi([\n ["mget", "multifoo", "multibar", redis.print],\n ["incr", "multifoo"],\n ["incr", "multibar"]\n ]).exec(function (err, replies) {\n console.log(replies);\n });\n```\n\n\n## Monitor mode\n\nRedis supports the `MONITOR` command, which lets you see all commands received by the Redis server\nacross all client connections, including from other client libraries and other computers.\n\nAfter you send the `MONITOR` command, no other commands are valid on that connection. `node_redis`\nwill emit a `monitor` event for every new monitor message that comes across. The callback for the\n`monitor` event takes a timestamp from the Redis server and an array of command arguments.\n\nHere is a simple example:\n\n```js\n var client = require("redis").createClient(),\n util = require("util");\n\n client.monitor(function (err, res) {\n console.log("Entering monitoring mode.");\n });\n\n client.on("monitor", function (time, args) {\n console.log(time + ": " + util.inspect(args));\n });\n```\n\n# Extras\n\nSome other things you might like to know about.\n\n## client.server_info\n\nAfter the ready probe completes, the results from the INFO command are saved in the `client.server_info`\nobject.\n\nThe `versions` key contains an array of the elements of the version string for easy comparison.\n\n > client.server_info.redis_version\n \'2.3.0\'\n > client.server_info.versions\n [ 2, 3, 0 ]\n\n## redis.print()\n\nA handy callback function for displaying return values when testing. Example:\n\n```js\n var redis = require("redis"),\n client = redis.createClient();\n\n client.on("connect", function () {\n client.set("foo_rand000000000000", "some fantastic value", redis.print);\n client.get("foo_rand000000000000", redis.print);\n });\n```\n\nThis will print:\n\n Reply: OK\n Reply: some fantastic value\n\nNote that this program will not exit cleanly because the client is still connected.\n\n## redis.debug_mode\n\nBoolean to enable debug mode and protocol tracing.\n\n```js\n var redis = require("redis"),\n client = redis.createClient();\n\n redis.debug_mode = true;\n\n client.on("connect", function () {\n client.set("foo_rand000000000000", "some fantastic value");\n });\n```\n\nThis will display:\n\n mjr:~/work/node_redis (master)$ node ~/example.js\n send command: *3\n $3\n SET\n $20\n foo_rand000000000000\n $20\n some fantastic value\n\n on_data: +OK\n\n`send command` is data sent into Redis and `on_data` is data received from Redis.\n\n## Multi-word commands\n\nTo execute redis multi-word commands like `SCRIPT LOAD` or `CLIENT LIST` pass\nthe second word as first parameter:\n\n client.script(\'load\', \'return 1\');\n client.multi().script(\'load\', \'return 1\').exec(...);\n client.multi([[\'script\', \'load\', \'return 1\']]).exec(...);\n\n## client.send_command(command_name, args, callback)\n\nUsed internally to send commands to Redis. For convenience, nearly all commands that are published on the Redis\nWiki have been added to the `client` object. However, if I missed any, or if new commands are introduced before\nthis library is updated, you can use `send_command()` to send arbitrary commands to Redis.\n\nAll commands are sent as multi-bulk commands. `args` can either be an Array of arguments, or omitted.\n\n## client.connected\n\nBoolean tracking the state of the connection to the Redis server.\n\n## client.command_queue.length\n\nThe number of commands that have been sent to the Redis server but not yet replied to. You can use this to\nenforce some kind of maximum queue depth for commands while connected.\n\nDon\'t mess with `client.command_queue` though unless you really know what you are doing.\n\n## client.offline_queue.length\n\nThe number of commands that have been queued up for a future connection. You can use this to enforce\nsome kind of maximum queue depth for pre-connection commands.\n\n## client.retry_delay\n\nCurrent delay in milliseconds before a connection retry will be attempted. This starts at `250`.\n\n## client.retry_backoff\n\nMultiplier for future retry timeouts. This should be larger than 1 to add more time between retries.\nDefaults to 1.7. The default initial connection retry is 250, so the second retry will be 425, followed by 723.5, etc.\n\n### Commands with Optional and Keyword arguments\n\nThis applies to anything that uses an optional `[WITHSCORES]` or `[LIMIT offset count]` in the [redis.io/commands](http://redis.io/commands) documentation.\n\nExample:\n```js\nvar args = [ \'myzset\', 1, \'one\', 2, \'two\', 3, \'three\', 99, \'ninety-nine\' ];\nclient.zadd(args, function (err, response) {\n if (err) throw err;\n console.log(\'added \'+response+\' items.\');\n\n // -Infinity and +Infinity also work\n var args1 = [ \'myzset\', \'+inf\', \'-inf\' ];\n client.zrevrangebyscore(args1, function (err, response) {\n if (err) throw err;\n console.log(\'example1\', response);\n // write your code here\n });\n\n var max = 3, min = 1, offset = 1, count = 2;\n var args2 = [ \'myzset\', max, min, \'WITHSCORES\', \'LIMIT\', offset, count ];\n client.zrevrangebyscore(args2, function (err, response) {\n if (err) throw err;\n console.log(\'example2\', response);\n // write your code here\n });\n});\n```\n\n## TODO\n\nBetter tests for auth, disconnect/reconnect, and all combinations thereof.\n\nStream large set/get values into and out of Redis. Otherwise the entire value must be in node\'s memory.\n\nPerformance can be better for very large values.\n\nI think there are more performance improvements left in there for smaller values, especially for large lists of small values.\n\n## How to Contribute\n- open a pull request and then wait for feedback (if\n [DTrejo](http://github.com/dtrejo) does not get back to you within 2 days,\n comment again with indignation!)\n\n## Contributors\nSome people have have added features and fixed bugs in `node_redis` other than me.\n\nOrdered by date of first contribution.\n[Auto-generated](http://github.com/dtrejo/node-authors) on Wed Jul 25 2012 19:14:59 GMT-0700 (PDT).\n\n- [Matt Ranney aka `mranney`](https://github.com/mranney)\n- [Tim-Smart aka `tim-smart`](https://github.com/tim-smart)\n- [Tj Holowaychuk aka `visionmedia`](https://github.com/visionmedia)\n- [rick aka `technoweenie`](https://github.com/technoweenie)\n- [Orion Henry aka `orionz`](https://github.com/orionz)\n- [Aivo Paas aka `aivopaas`](https://github.com/aivopaas)\n- [Hank Sims aka `hanksims`](https://github.com/hanksims)\n- [Paul Carey aka `paulcarey`](https://github.com/paulcarey)\n- [Pieter Noordhuis aka `pietern`](https://github.com/pietern)\n- [nithesh aka `nithesh`](https://github.com/nithesh)\n- [Andy Ray aka `andy2ray`](https://github.com/andy2ray)\n- [unknown aka `unknowdna`](https://github.com/unknowdna)\n- [Dave Hoover aka `redsquirrel`](https://github.com/redsquirrel)\n- [Vladimir Dronnikov aka `dvv`](https://github.com/dvv)\n- [Umair Siddique aka `umairsiddique`](https://github.com/umairsiddique)\n- [Louis-Philippe Perron aka `lp`](https://github.com/lp)\n- [Mark Dawson aka `markdaws`](https://github.com/markdaws)\n- [Ian Babrou aka `bobrik`](https://github.com/bobrik)\n- [Felix Geisendörfer aka `felixge`](https://github.com/felixge)\n- [Jean-Hugues Pinson aka `undefined`](https://github.com/undefined)\n- [Maksim Lin aka `maks`](https://github.com/maks)\n- [Owen Smith aka `orls`](https://github.com/orls)\n- [Zachary Scott aka `zzak`](https://github.com/zzak)\n- [TEHEK Firefox aka `TEHEK`](https://github.com/TEHEK)\n- [Isaac Z. Schlueter aka `isaacs`](https://github.com/isaacs)\n- [David Trejo aka `DTrejo`](https://github.com/DTrejo)\n- [Brian Noguchi aka `bnoguchi`](https://github.com/bnoguchi)\n- [Philip Tellis aka `bluesmoon`](https://github.com/bluesmoon)\n- [Marcus Westin aka `marcuswestin2`](https://github.com/marcuswestin2)\n- [Jed Schmidt aka `jed`](https://github.com/jed)\n- [Dave Peticolas aka `jdavisp3`](https://github.com/jdavisp3)\n- [Trae Robrock aka `trobrock`](https://github.com/trobrock)\n- [Shankar Karuppiah aka `shankar0306`](https://github.com/shankar0306)\n- [Ignacio Burgueño aka `ignacio`](https://github.com/ignacio)\n\nThanks.\n\n## LICENSE - "MIT License"\n\nCopyright (c) 2010 Matthew Ranney, http://ranney.com/\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the "Software"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n\n![spacer](http://ranney.com/1px.gif)\n',
42 silly resolved readmeFilename: 'README.md',
42 silly resolved bugs: { url: 'https://github.com/mranney/node_redis/issues' },
42 silly resolved _id: 'redis@0.8.3',
42 silly resolved _from: 'redis@' } ]
43 info install redis@0.8.3 into /Applications/MAMP/htdocs/node-redis-test
44 info installOne redis@0.8.3
45 verbose from cache /Users/fcodello/.npm/redis/0.8.3/package/package.json
46 info /Applications/MAMP/htdocs/node-redis-test/node_modules/redis unbuild
47 verbose from cache /Applications/MAMP/htdocs/node-redis-test/node_modules/redis/package.json
48 info preuninstall redis@0.8.3
49 info uninstall redis@0.8.3
50 verbose true,/Applications/MAMP/htdocs/node-redis-test/node_modules,/Applications/MAMP/htdocs/node-redis-test/node_modules unbuild redis@0.8.3
51 info postuninstall redis@0.8.3
52 verbose tar unpack /Users/fcodello/.npm/redis/0.8.3/package.tgz
53 silly lockFile 2db43743-de-redis-test-node-modules-redis /Applications/MAMP/htdocs/node-redis-test/node_modules/redis
54 verbose lock /Applications/MAMP/htdocs/node-redis-test/node_modules/redis /Users/fcodello/.npm/2db43743-de-redis-test-node-modules-redis.lock
55 silly lockFile d8c0b9b6-ello-npm-redis-0-8-3-package-tgz /Users/fcodello/.npm/redis/0.8.3/package.tgz
56 verbose lock /Users/fcodello/.npm/redis/0.8.3/package.tgz /Users/fcodello/.npm/d8c0b9b6-ello-npm-redis-0-8-3-package-tgz.lock
57 silly gunzTarPerm modes [ '755', '644' ]
58 silly gunzTarPerm extractEntry package.json
59 silly gunzTarPerm extractEntry .npmignore
60 silly gunzTarPerm extractEntry README.md
61 silly gunzTarPerm extractEntry diff_multi_bench_output.js
62 silly gunzTarPerm extractEntry generate_commands.js
63 silly gunzTarPerm extractEntry multi_bench.js
64 silly gunzTarPerm extractEntry test.js
65 silly gunzTarPerm extractEntry index.js
66 silly gunzTarPerm extractEntry lib/commands.js
67 silly gunzTarPerm extractEntry lib/queue.js
68 silly gunzTarPerm extractEntry lib/to_array.js
69 silly gunzTarPerm extractEntry lib/util.js
70 silly gunzTarPerm extractEntry lib/parser/hiredis.js
71 silly gunzTarPerm extractEntry lib/parser/javascript.js
72 silly gunzTarPerm extractEntry benches/buffer_bench.js
73 silly gunzTarPerm extractEntry benches/hiredis_parser.js
74 silly gunzTarPerm extractEntry benches/re_sub_test.js
75 silly gunzTarPerm extractEntry benches/reconnect_test.js
76 silly gunzTarPerm extractEntry benches/sub_quit_test.js
77 silly gunzTarPerm extractEntry benches/stress/codec.js
78 silly gunzTarPerm extractEntry benches/stress/pubsub/pub.js
79 silly gunzTarPerm extractEntry benches/stress/pubsub/server.js
80 silly gunzTarPerm extractEntry benches/stress/pubsub/run
81 silly gunzTarPerm extractEntry benches/stress/rpushblpop/pub.js
82 silly gunzTarPerm extractEntry benches/stress/rpushblpop/server.js
83 silly gunzTarPerm extractEntry benches/stress/rpushblpop/run
84 silly gunzTarPerm extractEntry benches/stress/speed/speed.js
85 silly gunzTarPerm extractEntry benches/stress/speed/00
86 silly gunzTarPerm extractEntry benches/stress/speed/plot
87 silly gunzTarPerm extractEntry benches/stress/speed/size-rate.png
88 silly gunzTarPerm extractEntry examples/auth.js
89 silly gunzTarPerm extractEntry examples/mget.js
90 silly gunzTarPerm extractEntry examples/monitor.js
91 silly gunzTarPerm extractEntry examples/multi.js
92 silly gunzTarPerm extractEntry examples/file.js
93 silly gunzTarPerm extractEntry examples/psubscribe.js
94 silly gunzTarPerm extractEntry examples/pub_sub.js
95 silly gunzTarPerm extractEntry examples/simple.js
96 silly gunzTarPerm extractEntry examples/sort.js
97 silly gunzTarPerm extractEntry examples/subqueries.js
98 silly gunzTarPerm extractEntry examples/extend.js
99 silly gunzTarPerm extractEntry examples/subquery.js
100 silly gunzTarPerm extractEntry examples/eval.js
101 silly gunzTarPerm extractEntry examples/unix_socket.js
102 silly gunzTarPerm extractEntry examples/backpressure_drain.js
103 silly gunzTarPerm extractEntry examples/web_server.js
104 silly gunzTarPerm extractEntry examples/multi2.js
105 silly gunzTarPerm extractEntry changelog.md
106 verbose read json /Applications/MAMP/htdocs/node-redis-test/node_modules/redis/package.json
107 silly lockFile 2db43743-de-redis-test-node-modules-redis /Applications/MAMP/htdocs/node-redis-test/node_modules/redis
108 silly lockFile 2db43743-de-redis-test-node-modules-redis /Applications/MAMP/htdocs/node-redis-test/node_modules/redis
109 silly lockFile d8c0b9b6-ello-npm-redis-0-8-3-package-tgz /Users/fcodello/.npm/redis/0.8.3/package.tgz
110 silly lockFile d8c0b9b6-ello-npm-redis-0-8-3-package-tgz /Users/fcodello/.npm/redis/0.8.3/package.tgz
111 info preinstall redis@0.8.3
112 verbose from cache /Applications/MAMP/htdocs/node-redis-test/node_modules/redis/package.json
113 verbose readDependencies using package.json deps
114 verbose from cache /Applications/MAMP/htdocs/node-redis-test/node_modules/redis/package.json
115 verbose readDependencies using package.json deps
116 silly resolved []
117 verbose about to build /Applications/MAMP/htdocs/node-redis-test/node_modules/redis
118 info build /Applications/MAMP/htdocs/node-redis-test/node_modules/redis
119 verbose from cache /Applications/MAMP/htdocs/node-redis-test/node_modules/redis/package.json
120 verbose linkStuff [ false,
120 verbose linkStuff false,
120 verbose linkStuff false,
120 verbose linkStuff '/Applications/MAMP/htdocs/node-redis-test/node_modules' ]
121 info linkStuff redis@0.8.3
122 verbose from cache /Applications/MAMP/htdocs/node-redis-test/package.json
123 error TypeError: Object.keys called on non-object
123 error at Function.keys (native)
123 error at /usr/local/lib/node_modules/npm/lib/build.js:111:18
123 error at process.startup.processNextTick.process._tickCallback (node.js:245:9)
124 error If you need help, you may report this log at:
124 error <http://github.com/isaacs/npm/issues>
124 error or email it to:
124 error <npm-@googlegroups.com>
125 error System Darwin 11.4.0
126 error command "node" "/usr/local/bin/npm" "install" "redis" "--save"
127 error cwd /Applications/MAMP/htdocs/node-redis-test
128 error node -v v0.8.23
129 error npm -v 1.2.21
130 error type called_on_non_object
131 verbose exit [ 1, true ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment