Adaltas

Redis ORM for NodeJs

Redis ORM for NodeJs

Installation

1
npm install ron

Usage

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
ron = require('ron');
// Client connection
client = ron({
    port: 6379
    host: '127.0.0.1'
    name: 'auth'
});
// Schema definition
Users = client.get('users');
Users.property('id', {identifier: true});
Users.property('username', {unique: true});
Users.property('email', {index: true, email: true});
Users.property('name', {});
// Record manipulation
Users.create(
    {username: 'ron', email: 'ron@domain.com'},
    function(err, user){
        console.log(err, user.id);
    }
)

The library provide

  • Documented and tested API
  • Records access with indexes and unique values
  • Records are pure object, no extended class, no magic

Client API

Schema API

Records API

Run tests

Start a redis server on the default port

1
redis-server ./conf/redis.conf

Run the tests with mocha:

1
make test
Fork me on GitHub