Sha256: 29885c0b0860293aef2447ecfce82d36ff8ef5d305b5f87cc07af17183ea9efb

Contents?: true

Size: 1.08 KB

Versions: 32

Compression:

Stored size: 1.08 KB

Contents

var http = require("http"),
    fs = require("fs");

function prettyCurrentTime() {
    var date = new Date();
    return date.toLocaleString();
}

function write_file(commands, path) {
    var file_contents, out_commands;

    console.log("Writing " + Object.keys(commands).length + " commands to " + path);

    file_contents = "// This file was generated by ./generate_commands.js on " + prettyCurrentTime() + "\n";

    out_commands = Object.keys(commands).map(function (key) {
        return key.toLowerCase();
    });

    file_contents += "module.exports = " + JSON.stringify(out_commands, null, "    ") + ";\n";

    fs.writeFile(path, file_contents);
}

http.get({host: "redis.io", path: "/commands.json"}, function (res) {
    var body = "";

    console.log("Response from redis.io/commands.json: " + res.statusCode);

    res.on('data', function (chunk) {
        body += chunk;
    });

    res.on('end', function () {
        write_file(JSON.parse(body), "lib/commands.js");
    });
}).on('error', function (e) {
    console.log("Error fetching command list from redis.io: " + e.message);
});

Version data entries

32 entries across 32 versions & 3 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
hooch-0.4.1 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
hooch-0.4.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
hooch-0.3.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
hooch-0.2.1 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
hooch-0.2.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
hooch-0.1.0 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
hooch-0.0.8 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
hooch-0.0.7 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
hooch-0.0.6 jasmine/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
entangled-0.0.16 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
entangled-0.0.15 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
entangled-0.0.14 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
entangled-0.0.13 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
entangled-0.0.12 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
entangled-0.0.11 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
entangled-0.0.10 spec/dummy/public/node_modules/karma/node_modules/socket.io/node_modules/redis/generate_commands.js
express_translate-1.0.13 node_modules/redis/generate_commands.js
express_translate-1.0.12 node_modules/redis/generate_commands.js
express_translate-1.0.11 node_modules/redis/generate_commands.js