aredis

Redis wrapper

Usage no npm install needed!

<script type="module">
  import aredis from 'https://cdn.skypack.dev/aredis';
</script>

README

aredis

Build Status npm Version JS Standard

Redis wrapper

Installation

$ npm install aredis --save

Usage

'use strict'

const aredis = require('aredis')
const co = require('co')

let redis = aredis({
    host: '127.0.0.1',
    db: 1 // db number of redis
  })

;(async () => {
  // Set and get string
  {
    await redis.set('foo', 'bar')
    let foo = await redis.get('foo')
    console.log(foo) // -> 'bar'
  }

  // Set and get hash
  {
    await aredis.hset('baz', 'quz', 'quzz')
    let baz = await aredis.hgetall('baz')
    console.log(baz) // -> {quz: 'quzz'}
  }
})()

License

This software is released under the MIT License.

Links