0.5.1 • Published 11 years ago

redis.jsx v0.5.1

Weekly downloads
4
License
-
Repository
github
Last release
11 years ago

redis.jsx

Synopsis

JSX wrapper for Redis node.js driver node-redis.

Code Example

import "redis.jsx";

class _Main {
    static function main(argv : string[]) : void
    {
        var client = redis.createClient();

        client.on('error', (err : Error) -> {
            console.log("error event -", client.host + ":" + client.port as string, "-", err);
        });

        client.set("string key", "string val", redis.print as (Error, string) -> void);
        client.hset("hash key", "hashtest 1", "some value", redis.print as (Error, int) -> void);
        client.hset("hash key", "hashtest 2", "some other value", redis.print as (Error, int) -> void);
        client.hkeys("hash key", (err, replies)->{
            if (err) {
                return console.error("error response -", err);
            }

            console.log(replies.length + " replies:");
            replies.forEach(function (reply, i) {
                console.log("    " + i + ": " + reply);
            });
        });

        client.quit((err, res)->{
            console.log("Exiting from quit command.");
        });
    }
}

Installation

$ npm install redis.jsx --save
$ npm install redis --save

API Reference

It is almost same as node-redis. Following points are different from node-redis:

  • Only small capital methods are avaialble.
  • Two keyword commands (SCRIPT LOAD) have new name, all small capital and joined (scriptload).

Development

Repository

Run Test

$ grunt test

Build Sample

$ grunt build

Build Document

$ grunt doc

Author
---------

* shibukawa / yoshiki@shibu.jp

License
------------

MIT

Complete license is written in `LICENSE.md`.
0.5.1

11 years ago

0.5.0

11 years ago