2.1.1 • Published 20 days ago

@keyvhq/offline v2.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
20 days ago

@keyvhq/offline

Adds offline capabilities for your keyv instance.

Install

$ npm install @keyvhq/offline --save

Usage

All you need to do is to wrap your keyv instance:

const KeyvRedis = require('@keyvhq/redis')
const Keyv = require('@keyvhq/core')

const store = new KeyvRedis({
  uri: 'redis://user:pass@localhost:6379',
  maxRetriesPerRequest: 1,
  emitErrors: false
})

const keyv = new Keyv({ store })

Using @keyvhq/offline at the top level:

const KeyvOffline = require('@keyvhq/offline')
const keyv = keyvOffline(new Keyv({ store }))

Since now, if your store suffers network connectivity issues, your keyv set/get petitions will be temporarily bypassed, preventing your application to crash for that, being more resilient than the default keyv behavior.

As soon as the connection is re-established, it will be work back as expected.

In case you need, you can see omitted errors enabling debug doing DEBUG=@keyvhq/offline*

License

@keyvhq/memoize © Kiko Beats, released under the MIT License. Maintained by Microlink with help from contributors.

microlink.io · GitHub microlinkhq · Twitter @microlinkhq

2.1.1

20 days ago

2.0.3

11 months ago

2.0.0-beta.0

1 year ago

1.6.28

1 year ago

2.0.0

1 year ago

1.6.26

1 year ago

1.6.13

2 years ago

1.6.6

2 years ago

1.6.5

2 years ago

1.3.0

3 years ago