Skip to content

2022-10-17

Compare
Choose a tag to compare
@jaredwray jaredwray released this 17 Oct 20:25
· 689 commits to main since this release
fb9ad27

2022-10-17 Release

There has been some bigger updates around the compression libraries and also updates to many of the packages. As always, this includes dependency updates which you can see below under What's Changed. Let's get started:

Typescript update to many of the storage adapters adding in <Value=any>

This was a fix for #512 and we have tested it but happy for any feedback on it.

Compression Packages are now more robust!

We did our initial look at how to add compression into the system and with this latest release made it much more robust. Currently supporting compress-brotli and compress-gzip each one of the packages now have type definitions and the main Keyv has an interface to define what these should look like:

	interface CompressionAdapter {
		async compress(value: any, options?: any);
		async decompress(value: any, options?: any);
		async serialize(value: any);
		async deserialize(value: any);
	}

To use these compression libraries you can do the following:

const KeyvBrotli = require('@keyv/compress-brotli');
const Keyv = require('keyv');

const keyv = new Keyv({store: new Map(), compression: new KeyvBrotli()});

NOTE: when you do use compression the functions serialize and deserialize are overwritten.

What's Changed

Full Changelog: 2022-09-19...2022-10-17