Browse Source
The 'somehow' in 'This list needs to be updated, and perhaps auto-updated somehow'gh-pages
Matt Ranney
14 years ago
3 changed files with 167 additions and 23 deletions
@ -0,0 +1,39 @@ |
|||
var http = require("http"), |
|||
sys = require("sys"), |
|||
fs = require("fs"); |
|||
|
|||
http.get({host: "redis.io", path: "/commands.json"}, function(res) { |
|||
console.log("Response from redis.io/commands.json: " + res.statusCode); |
|||
|
|||
var commandString = ""; |
|||
res.on('data', function(chunk) { |
|||
commandString += chunk; |
|||
}); |
|||
|
|||
res.on('end', function() { |
|||
var commands = JSON.parse(commandString); |
|||
writeCommandsToFile(commands, "lib/commands.js"); |
|||
}) |
|||
}).on('error', function(e) { |
|||
console.log("Got error: " + e.message); |
|||
}); |
|||
|
|||
function writeCommandsToFile(commands, path) { |
|||
console.log("Writing " + path); |
|||
|
|||
var fileContents = "// This file was generated by ./generate_commands.js on " + prettyCurrentTime() + "\n"; |
|||
|
|||
var lowerCommands = []; |
|||
for (var command in commands) { |
|||
lowerCommands.push(command.toLowerCase()); |
|||
} |
|||
|
|||
fileContents += "exports.Commands = " + JSON.stringify(lowerCommands, null, " ") + ";\n"; |
|||
|
|||
fs.writeFile(path, fileContents); |
|||
} |
|||
|
|||
function prettyCurrentTime() { |
|||
var date = new Date(); |
|||
return date.toLocaleString(); |
|||
} |
@ -0,0 +1,126 @@ |
|||
// This file was generated by ./generate_commands.js on Thu Jun 02 2011 21:50:36 GMT-0500 (CDT)
|
|||
exports.Commands = [ |
|||
"append", |
|||
"auth", |
|||
"bgrewriteaof", |
|||
"bgsave", |
|||
"blpop", |
|||
"brpop", |
|||
"brpoplpush", |
|||
"config get", |
|||
"config set", |
|||
"config resetstat", |
|||
"dbsize", |
|||
"debug object", |
|||
"debug segfault", |
|||
"decr", |
|||
"decrby", |
|||
"del", |
|||
"discard", |
|||
"echo", |
|||
"exec", |
|||
"exists", |
|||
"expire", |
|||
"expireat", |
|||
"flushall", |
|||
"flushdb", |
|||
"get", |
|||
"getbit", |
|||
"getrange", |
|||
"getset", |
|||
"hdel", |
|||
"hexists", |
|||
"hget", |
|||
"hgetall", |
|||
"hincrby", |
|||
"hkeys", |
|||
"hlen", |
|||
"hmget", |
|||
"hmset", |
|||
"hset", |
|||
"hsetnx", |
|||
"hvals", |
|||
"incr", |
|||
"incrby", |
|||
"info", |
|||
"keys", |
|||
"lastsave", |
|||
"lindex", |
|||
"linsert", |
|||
"llen", |
|||
"lpop", |
|||
"lpush", |
|||
"lpushx", |
|||
"lrange", |
|||
"lrem", |
|||
"lset", |
|||
"ltrim", |
|||
"mget", |
|||
"monitor", |
|||
"move", |
|||
"mset", |
|||
"msetnx", |
|||
"multi", |
|||
"object", |
|||
"persist", |
|||
"ping", |
|||
"psubscribe", |
|||
"publish", |
|||
"punsubscribe", |
|||
"quit", |
|||
"randomkey", |
|||
"rename", |
|||
"renamenx", |
|||
"rpop", |
|||
"rpoplpush", |
|||
"rpush", |
|||
"rpushx", |
|||
"sadd", |
|||
"save", |
|||
"scard", |
|||
"sdiff", |
|||
"sdiffstore", |
|||
"select", |
|||
"set", |
|||
"setbit", |
|||
"setex", |
|||
"setnx", |
|||
"setrange", |
|||
"shutdown", |
|||
"sinter", |
|||
"sinterstore", |
|||
"sismember", |
|||
"slaveof", |
|||
"smembers", |
|||
"smove", |
|||
"sort", |
|||
"spop", |
|||
"srandmember", |
|||
"srem", |
|||
"strlen", |
|||
"subscribe", |
|||
"sunion", |
|||
"sunionstore", |
|||
"sync", |
|||
"ttl", |
|||
"type", |
|||
"unsubscribe", |
|||
"unwatch", |
|||
"watch", |
|||
"zadd", |
|||
"zcard", |
|||
"zcount", |
|||
"zincrby", |
|||
"zinterstore", |
|||
"zrange", |
|||
"zrangebyscore", |
|||
"zrank", |
|||
"zrem", |
|||
"zremrangebyrank", |
|||
"zremrangebyscore", |
|||
"zrevrange", |
|||
"zrevrangebyscore", |
|||
"zrevrank", |
|||
"zscore", |
|||
"zunionstore" |
|||
]; |
Loading…
Reference in new issue