npm install ronron=require('ron');// Client connectionclient=ron({port: 6379,host: '127.0.0.1',name: 'auth'});// Schema definitionUsers=client.get('users');Users.property('id',{identifier: true});Users.property('username',{unique: true});Users.property('email',{index: true,type: 'email'});Users.property('name',{});// Record manipulationUsers.create({username: 'ron',email: 'ron@domain.com'},function(err,user){console.log(err,user.id);});- Documented and tested API
- Records access with indexes and unique values
- Records are pure object, no state, no magic
- Records::hash
- Records::identifier
- Records::index
- Records::property
- Records::name
- Records::serialize
- Records::temporal
- Records::unique
- Records::unserialize
- Records::validate
- Records::all
- Records::clear
- Records::count
- Records::create
- Records::exists
- Records::get
- Records::id
- Records::list
- Records::remove
- Records::update
Run the tests with mocha:
npm run redis_start
npm test
npm run redis_stopNote, the command above use a Docker container. You can use you're own Redis server by only running npm test after modifying the configuration file located in "conf/test.coffee".
If Redis is installed, start a redis server on the default port:
redis-server ./conf/redis.conf
If Docker is installed, start a container:
docker run --name ron -p 6379:6379 -d redis redis-server --appendonly yes
