diff --git a/README.md b/README.md new file mode 100644 index 0000000..a067a07 --- /dev/null +++ b/README.md @@ -0,0 +1,45 @@ + +logo + +[![project status](https://momentohq.github.io/standards-and-practices/badges/project-status-official.svg)](https://github.com/momentohq/standards-and-practices/blob/main/docs/momento-on-github.md) +[![project stability](https://momentohq.github.io/standards-and-practices/badges/project-stability-alpha.svg)](https://github.com/momentohq/standards-and-practices/blob/main/docs/momento-on-github.md) + + +

Keyv - Momento Keyv logo

+

This project is part of the Keyv suite.

+ +## What and why? + +This project is a [Momento](https://gomomento.com) storage adaptor for [Keyv](https://github.com/jaredwray/keyv) + +TTL functionality is handled directly by momento so no timestamps are stored and expired keys are cleaned up internally. + +## Installation + +```shell +npm install --save @gomomento-poc/node-keyv-adaptor +``` + +## Usage + +```ts +import KeyvMomento from "@gomomento-poc/node-keyv-adaptor"; + +const Keyv = require('keyv'); + +const keyv = new Keyv({ + store: new KeyvMomento( + new CacheClient({ + configuration: Configurations.Laptop.latest(), + credentialProvider: CredentialProvider.fromEnvironmentVariable({ + environmentVariableName: "MOMENTO_AUTH_TOKEN" + }), + defaultTtlSeconds: 6000 + }), + "default-cache", + ) +}) +``` + +---------------------------------------------------------------------------------------- +For more info, visit our website at [https://gomomento.com](https://gomomento.com)!