@keyvhq/compress

    1.6.1 • Public • Published

    @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 = new KeyvRedis({
      uri: 'redis://user:pass@localhost:6379',
      maxRetriesPerRequest: 1,
      emitErrors: false
    })

    Using @keyvhq/compress at the top level:

    const KeyvCompress = require('@keyvhq/compress')
    const KeyvRedis = require('@keyvhq/redis')
    
    const keyv = KeyvCompress(new KeyvRedis({
      uri: 'redis://user:pass@localhost:6379',
      maxRetriesPerRequest: 1,
      emitErrors: false
    }))

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

    const keyv = KeyvCompress(new KeyvRedis({
      uri: 'redis://user:pass@localhost:6379',
      maxRetriesPerRequest: 1,
      emitErrors: false
    }), {
      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

    Install

    npm i @keyvhq/compress

    Homepage

    keyv.js.org

    DownloadsWeekly Downloads

    44

    Version

    1.6.1

    License

    MIT

    Unpacked Size

    4.53 kB

    Total Files

    4

    Last publish

    Collaborators

    • kikobeats
    • jytesh