Socket
Socket
Sign inDemoInstall

@repositories/redis

Package Overview
Dependencies
13
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @repositories/redis

Generic IRepository implementation for Redis


Version published
Weekly downloads
69
decreased by-9.21%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Redis Repository

NPM version NPM Downloads

Installation

$ npm install --save @repositories/redis

Usage


'use strict';

const redis = require('redis');
const client = redis.createClient();
const RedisRepository = require('@repositories/redis');

class TodoRepository extends RedisRepository {
  constructor(client){
    super(client, 'todos');
  }
  // custom implementations
}

// or if you dont need custom functionality

const repo = new RedisRepository(client, 'todos');

repo.add({ name: 'Tom' }, (err, doc) => {
  console.log(doc);
});
 
// expire after 5 seconds
repo.add({ name: 'Tom' }, { expire: 5 }, (err, doc) => {
  console.log(doc);
});

Keywords

FAQs

Last updated on 20 Sep 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc