New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

shelf

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

shelf - npm Package Compare versions

Comparing version 2.2.1 to 3.0.0

56

package.json
{
"name": "shelf",
"version": "2.2.1",
"description": "Redis Object Document Mapper (ODM)",
"main": "index.js",
"scripts": {
"test": "./node_modules/lab/bin/lab --verbose",
"test-cov": "./node_modules/lab/bin/lab --verbose -c",
"lint": "standard --verbose | snazzy"
},
"repository": "https://github.com/shelf-js/shelf",
"pre-commit": [
"lint",
"test"
],
"keywords": [
"redis",
"odm",
"object",
"document",
"mapper",
"storage",
"fast"
],
"author": [
{
"name": "Ricardo Barros",
"email": "ricardofbarros@hotmail.com"
},
{
"name": "João Antunes",
"email": "j.goncalo.antunes@gmail.com"
},
{
"name": "Pedro Carvalho",
"email": "pedromatosdecarvalho@gmail.com"
}
],
"license": "MIT",
"devDependencies": {
"code": "^2.1.0",
"lab": "^8.2.0",
"pre-commit": "^1.1.2",
"proxyquire": "^1.7.4",
"snazzy": "^2.0.1",
"standard": "^6.0.4"
},
"dependencies": {
"async": "^2.0.0-rc.5",
"hiredis": "^0.4.1",
"joi": "^7.2.3",
"lodash": "^4.12.0",
"redis": "^2.4.2"
}
"version": "3.0.0",
"description": "Database for Frontend Developers",
"author": "siddharthkp",
"license": "MIT"
}

@@ -1,50 +0,6 @@

![shelf Logo](https://avatars1.githubusercontent.com/u/14891842?v=3&s=200)
Object Document Mapper (ODM) for Node.js who uses Redis as its store.
[![Build Status](https://travis-ci.org/shelf-js/shelf.svg?branch=master)](https://travis-ci.org/shelf-js/shelf)
[![npm version](https://img.shields.io/npm/v/shelf.svg)](https://www.npmjs.com/package/shelf)
# Introduction
If you need to store complex objects do Redis, but don't want to go through the trouble of translating your objects to a key, value store, then Shelf is for you.
Shelf gives you CRUD operation on your objects over Redis, so you can create complex schemas and validate models.
Shelf uses [joi](https://github.com/hapijs/joi) for schema validation.
> If you're using 0.10 or 0.12 node version, please use `shelf@1`. You can also look at the code at the `1.x.x` branch.
# Example
```javascript
const Shelf = require('shelf')
const Joi = require('joi')
const Storage = Shelf('MyApp', {
port: 6379,
host: '127.0.0.1'
})
const MyModel = Storage.extend({
name: 'MySchema',
props: Joi.object().keys({
prop1: Joi.string(),
prop2: Joi.string()
}),
keys: ['prop1']
})
let myModel = MyModel({prop1: 'Hello'})
myModel.save()
```
You can (and should) move your DB connection (Shelf) and Schema (returned by the extend method) to different files to get better readability.
Check the examples for further information.
# Contributing
We use [standard js](https://github.com/feross/standard).
In order to run the tests you should have an Redis instance running locally.
<p align="center">
<img alt="Database for
Frontend Developers" src="https://sid.studio/assets/shelf-cover.png"/>
<br/><br/>
<a href="https://sid.studio/shelf/">sid.studio/shelf</a>
</p>
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