2.1.1 • Published 11 days ago

@keyvhq/compress v2.1.1

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

@keyvhq/compress

Adds compression bindings for your Keyv instance.

Install

$ npm install @keyvhq/compress --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/compress at the top level:

const KeyvCompress = require('@keyvhq/compress')
const keyv = KeyvCompress(new Keyv({ store }))

Additionally, it can accept compress-brotli#options as second argument:

const keyv = KeyvCompress(
  new Keyv({ store }),
  {
    serialize: v8.serialize,
    deserialize: v8.deserialize
  }
)

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

11 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.20

2 years ago

1.6.13

2 years ago

1.6.6

2 years ago

1.6.5

2 years ago

1.6.1

3 years ago

1.3.0

3 years ago