Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ron

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ron - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

conf/dump.rdb

37

package.json

@@ -1,14 +0,23 @@

{ "name": "ron"
, "version": "0.0.2"
, "description": "Redis ORM for NodeJs"
, "author": "David Worms <david@adaltas.com>"
, "contributors":
[ ]
, "main": "./lib/ron"
, "engines": { "node": ">= 0.3.0" }
, "keywords": ["redis", "orm", "database", "nosql"]
, "repository":
{ "type" : "git"
, "url" : "https://github.com/wdavidw/node-redis-orm.git"
}
}
{
"name": "ron",
"version": "0.0.3",
"description": "Redis ORM for NodeJs",
"author": "David Worms <david@adaltas.com>",
"contributors": [
{ "name": "David Worms", "email": "david@adaltas.com" }
],
"dependencies": {
"redis": "latest"
},
"devDependencies": {
"expresso": "latest"
},
"engines": {
"node": ">= 0.3.0"
},
"keywords": ["redis", "orm", "database", "nosql"],
"repository": {
"type": "git",
"url": "https://github.com/wdavidw/node-redis-orm.git"
}
}

@@ -5,3 +5,3 @@

Be carefull, this project is experimental.
Ad-lib, be carefull, this project is experimental.

@@ -12,3 +12,5 @@ The library provide

* Simple & tested API
* Unique index keys
* Sortable indexes and unique values
* Records are pure object, no extended class, no magic properties
* Code, tests and readme written in coffescript, samples written in javascript

@@ -18,48 +20,58 @@ Quick exemple

var ron = require('ron');
ron = require 'ron'
app = ron
host: ''
port: ''
name: 'auth'
var Users = ron.create('Users')
// A unique property identifier, default to id
.identify('id_user')
// Create a unique index
.unique('username')
// Create an index
.index('lastname');
Users.put({
username: 'my_username',
lastname: 'My Lastname'
}, function(err, user){
Users.get(user.id_user, function(err, user){
Users.delete(user.id_user, function(err){
console.log(user.id_user + ' created and then removed');
})
})
})
User = app.create 'users'
User.property 'id',
identifier: true
# Use a hash index
User.property 'username',
type: 'string'
unique: true
# Use a sorted set index
User.property 'email',
type: 'string'
index: true
Implementation
--------------
Client API
----------
Unique identifiers are incremented from a string:
* Client::constructor
* Client::quit
* Client::create
count:{Model}
Schema API
----------
Model identifiers are indexed in a set:
* Records::property
* Records::identifier
* Records::unique
* Records::index
* Records::email
index:{model}
Record API
----------
Unique indexes are stored in a hash with keys as identifier:
* Records::all
* Records::count
* Records::create
* Records::exists
* Records::get
* Records::id
* Records::list
* Records::remove
* Records::update
index:{model}:{property}
Object data are stored in a hash
obj:{model}:{id}
Run tests
---------
The test suite is integrated with *expresso* and should be run synchronously since they share the same redis client.
Start a redis server (tested against version 2.9.0) on the default port
redis-server ./conf/redis.conf
To run the tests, simply start redis `redis-server ./conf/redis.conf` and type `expresso -s` inside the project folder.
Run the test suite with *expresso*:
expresso -s

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc