2.1.5 • Published 11 months ago

@keyvhq/compress v2.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months 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 · X @microlinkhq

2.1.5

11 months ago

2.1.1

1 year ago

2.0.3

2 years ago

2.0.0-beta.0

2 years ago

1.6.28

2 years ago

2.0.0

2 years ago

1.6.26

2 years ago

1.6.20

3 years ago

1.6.13

3 years ago

1.6.6

3 years ago

1.6.5

3 years ago

1.6.1

4 years ago

1.3.0

4 years ago