https://github.com/devfans/redis-async-wrapper
Redis keys async wrapper
https://github.com/devfans/redis-async-wrapper
Last synced: 6 months ago
JSON representation
Redis keys async wrapper
- Host: GitHub
- URL: https://github.com/devfans/redis-async-wrapper
- Owner: devfans
- Created: 2018-01-05T10:20:38.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T12:50:02.000Z (over 3 years ago)
- Last Synced: 2025-09-15T12:29:03.946Z (7 months ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# redis-async-wrapper
[](https://gitter.im/devfans/redis-async-wrapper?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
[![NPM Version][npm-image]][npm-url]
[![NPM Downloads][downloads-image]][downloads-url]
[![Build Status][travis-image]][travis-url]
[![Test Coverage][coveralls-image]][coveralls-url]
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 !
[npm-image]: https://img.shields.io/npm/v/redis-async-wrapper.svg
[npm-url]: https://npmjs.org/package/redis-async-wrapper
[travis-image]: https://img.shields.io/travis/devfans/redis-async-wrapper/master.svg
[travis-url]: https://travis-ci.org/devfans/redis-async-wrapper
[coveralls-image]: https://img.shields.io/coveralls/devfans/redis-async-wrapper/master.svg
[coveralls-url]: https://coveralls.io/r/devfans/redis-async-wrapper?branch=master
[downloads-image]: https://img.shields.io/npm/dm/redis-async-wrapper.svg
[downloads-url]: https://npmjs.org/package/redis-async-wrapper