redis.jsx

0.5.1 • Public • Published

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`.

Readme

Keywords

none

Package Sidebar

Install

npm i redis.jsx

Weekly Downloads

0

Version

0.5.1

License

MIT

Last publish

Collaborators

  • shibu