@selfagency/asyncredis
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

Asyncredis

Event-driven async wrapper for ioredis with TypeScript support. Not a full implementation as of yet.

Install

npm i @selfagency/asyncredis

Usage

import { Cache } from '@selfagency/asyncredis'

// define cache (ioredis config object)
const cache = new Cache({
  host: 'localhost',
  port: 6379,
  password: 'password',
  db: 0,
})

// define key
const key = 'my:awesome:key'

// define ttl
const ttl = 60 * 60 // 1 hour (default)

// set value
await cache.set(key, { some: 'data' }, ttl)

// get value
const result = await cache.get(key)

// result = { some: 'data' }

Package Sidebar

Install

npm i @selfagency/asyncredis

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

6 kB

Total Files

5

Last publish

Collaborators

  • dsieradski