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

ron

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ron

Redis ORM for NodeJs

  • 0.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by160%
Maintainers
0
Weekly downloads
 
Created
Source

Redis ORM for NodeJs

Be carefull, this project is experimental.

The library provide

  • Simple & tested API
  • Unique index keys

Quick exemple

var ron = require('ron');

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');
		})
	})
})

Implementation

Unique identifiers are incremented from a string:

count:{Model}

Model identifiers are indexed in a set:

index:{model}

Unique indexes are stored in a hash with keys as identifier:

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.

To run the tests, simply start redis redis-server ./conf/redis.conf and type expresso -s inside the project folder.

Keywords

FAQs

Package last updated on 21 Feb 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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