Comparing version 0.0.4 to 0.0.5
@@ -6,4 +6,2 @@ | ||
var Table = require('./lib/Table'); | ||
module.exports = function(options){ | ||
@@ -15,2 +13,4 @@ return new Client(options); | ||
module.exports.Table = Table; | ||
module.exports.Records = require('./lib/Records'); | ||
module.exports.Schema = require('./lib/Schema'); |
@@ -5,3 +5,3 @@ { | ||
"keywords": ["redis", "orm", "database", "nosql"], | ||
"version": "0.0.4", | ||
"version": "0.0.5", | ||
"homepage": "http://www.adaltas.com/projects/node-ron", | ||
@@ -18,5 +18,8 @@ "author": "David Worms <david@adaltas.com>", | ||
"dependencies": { | ||
"coffee-script": "latest", | ||
"redis": "latest" | ||
}, | ||
"devDependencies": { | ||
"each": "latest", | ||
"mecano": "latest", | ||
"mocha": "latest", | ||
@@ -31,4 +34,4 @@ "should": "latest" | ||
"scripts": { | ||
"test": "mocha" | ||
"test": "make test" | ||
} | ||
} |
@@ -0,1 +1,2 @@ | ||
[![Build Status](https://secure.travis-ci.org/wdavidw/node-ron.png)](http://travis-ci.org/wdavidw/node-ron) | ||
@@ -17,12 +18,21 @@ Redis ORM for NodeJs | ||
ron = require('ron'); | ||
// Client connection | ||
client = ron({ | ||
redis_port: 6379 | ||
redis_host: '127.0.0.1' | ||
port: 6379 | ||
host: '127.0.0.1' | ||
name: 'auth' | ||
}); | ||
users = client.define('users'); | ||
users.property('id', {identifier: true}); | ||
users.property('username', {unique: true}); | ||
users.property('email', {index: true, email: true}); | ||
users.property('name', {}); | ||
// Schema definition | ||
Users = client.get('users'); | ||
Users.property('id', {identifier: true}); | ||
Users.property('username', {unique: true}); | ||
Users.property('email', {index: true, type: 'email'}); | ||
Users.property('name', {}); | ||
// Record manipulation | ||
Users.create( | ||
{username: 'ron', email: 'ron@domain.com'}, | ||
function(err, user){ | ||
console.log(err, user.id); | ||
} | ||
) | ||
``` | ||
@@ -33,5 +43,5 @@ | ||
* Simple & tested API | ||
* Sortable indexes and unique values | ||
* Records are pure object, no extended class, no magic properties | ||
* Documented and tested API | ||
* Records access with indexes and unique values | ||
* Records are pure object, no state, no magic | ||
@@ -41,5 +51,5 @@ Client API | ||
* Client::constructor | ||
* Client::quit | ||
* Client::define | ||
* [Client::constructor](http://www.adaltas.com/projects/node-ron/client.html#ron) | ||
* [Client::get](http://www.adaltas.com/projects/node-ron/client.html#get) | ||
* [Client::quit](http://www.adaltas.com/projects/node-ron/client.html#quit) | ||
@@ -49,20 +59,26 @@ Schema API | ||
* Records::property | ||
* Records::identifier | ||
* Records::index | ||
* Records::unique | ||
* Records::email | ||
* [Records::hash](http://www.adaltas.com/projects/node-ron/schema.html#hash) | ||
* [Records::identifier](http://www.adaltas.com/projects/node-ron/schema.html#identifier) | ||
* [Records::index](http://www.adaltas.com/projects/node-ron/schema.html#index) | ||
* [Records::property](schema.html#property) | ||
* [Records::name](http://www.adaltas.com/projects/node-ron/schema.html#name) | ||
* [Records::serialize](http://www.adaltas.com/projects/node-ron/schema.html#serialize) | ||
* [Records::temporal](http://www.adaltas.com/projects/node-ron/schema.html#temporal) | ||
* [Records::unique](http://www.adaltas.com/projects/node-ron/schema.html#unique) | ||
* [Records::unserialize](http://www.adaltas.com/projects/node-ron/schema.html#unserialize) | ||
* [Records::validate](http://www.adaltas.com/projects/node-ron/schema.html#validate) | ||
Record API | ||
---------- | ||
Records API | ||
----------- | ||
* Records::all | ||
* Records::count | ||
* Records::create | ||
* Records::exists | ||
* Records::get | ||
* Records::id | ||
* Records::list | ||
* Records::remove | ||
* Records::update | ||
* [Records::all](http://www.adaltas.com/projects/node-ron/records.html#all) | ||
* [Records::clear](http://www.adaltas.com/projects/node-ron/records.html#clear) | ||
* [Records::count](http://www.adaltas.com/projects/node-ron/records.html#count) | ||
* [Records::create](http://www.adaltas.com/projects/node-ron/records.html#create) | ||
* [Records::exists](http://www.adaltas.com/projects/node-ron/records.html#exists) | ||
* [Records::get](http://www.adaltas.com/projects/node-ron/records.html#get) | ||
* [Records::id](http://www.adaltas.com/projects/node-ron/records.html#id) | ||
* [Records::list](http://www.adaltas.com/projects/node-ron/records.html#list) | ||
* [Records::remove](http://www.adaltas.com/projects/node-ron/records.html#remove) | ||
* [Records::update](http://www.adaltas.com/projects/node-ron/records.html#update) | ||
@@ -72,3 +88,3 @@ Run tests | ||
Start a redis server (tested against version 2.9.0) on the default port | ||
Start a redis server on the default port | ||
```bash | ||
@@ -78,7 +94,7 @@ redis-server ./conf/redis.conf | ||
Run the test suite with *expresso*: | ||
Run the tests with mocha: | ||
```bash | ||
expresso -s | ||
make test | ||
``` | ||
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
119228
33
95
2
4
+ Addedcoffee-script@latest
+ Addedcoffee-script@1.12.7(transitive)