Socket
Socket
Sign inDemoInstall

@selfagency/asyncredis

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@selfagency/asyncredis

Event-driven async wrapper for ioredis with TypeScript support.


Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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' }

Keywords

FAQs

Package last updated on 29 Nov 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc