JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 445
  • Score
    100M100P100Q97217F
  • License MIT

Adds compression bindings for your Keyv instance, saving as much space as you can.

Package Exports

  • @keyvhq/compress
  • @keyvhq/compress/src/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@keyvhq/compress) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@keyvhq/compress keyv

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