Problem using '@keyv/compress-gzip' with redis
cmartin81 opened this issue · 1 comments
cmartin81 commented
Just tried adding '@keyv/compress-gzip' to my keyv instance.
import Keyv from 'keyv';
const KeyvGzip = require('@keyv/compress-gzip');
const klineCache = new Keyv('redis://localhost:6379', { compression: new KeyvGzip()});
When trying to fetch an object I know that is not in cache I get this error:
return JSON.parse(s, function (key, value) {
^
SyntaxError: "undefined" is not valid JSON
Should compress-gzip handle undefined objects?
Kikobeats commented
Hello!
The right package to use is @keyvhq/compress
Check it https://github.com/microlinkhq/keyv/tree/master/packages/compress 🙂