🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

redis-async-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

redis-async-wrapper

redis data layer async wrapper

0.1.0
latest
Source
npm
Version published
Weekly downloads
53
2550%
Maintainers
1
Weekly downloads
 
Created
Source

redis-async-wrapper

Join the chat at https://gitter.im/devfans/redis-async-wrapper NPM Version NPM Downloads Build Status Test Coverage

Redis keys async wrapper

Installation

npm install --save redis-async-wrapper

NOTE

Only a part of redis commands added in this wrapper till now.

Get Started

const dal = require('redis-async-wrapper')

// init with options
dal.init({url: "redis://host:port", keyPrefix: "app"})

// define keys conventions
const Templates = {
  user: "user:%s:%s" //  user:userId:type
}

// define model
const User = new dal.Redis_Hash({tpl:Templates.user})

User.save = async (id, type,  infoObject) => {
  await User.hmset([id, type], infoObject)
  const user = await User.hgetall([id, type])
  console.log(`user ${user.name} is saved`)
}

User.save(1, 1, {name: "stefan"})

Contributors Wanted

Glad to get contributors to this library, contact me at stefanliu@outlook.com !

Keywords

redis

FAQs

Package last updated on 05 Sep 2019

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