Skip to content

Add custom serializer option #26

@lukechilds

Description

@lukechilds

Currently JSONB.stringify/JSONB.parse is used for serializing/deserializing to support a wide range JavaScript Types.

Allowing users to set a custom a custom serializer function will allow for cleaner usage with custom data structures and enable performance improvements for people who don't need all the type support JSONB provides.

Syntax should look something like:

const Keyv = require('keyv');
const { serialize, deserialize } = require('my-serializer');

const keyv = new Keyv({ serialize, deserialize });

Previous discussion in #22

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions