Skip to content

Latest commit

 

History

History
40 lines (28 loc) · 1.08 KB

README.template.md

File metadata and controls

40 lines (28 loc) · 1.08 KB

{{ ossHeader }}

Keyv - Momento Keyv logo

This project is part of the Keyv suite.

What and why?

This project is a Momento storage adaptor for Keyv

TTL functionality is handled directly by momento so no timestamps are stored and expired keys are cleaned up internally.

Installation

npm install --save @gomomento-poc/node-keyv-adaptor

Usage

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",
  )
})

{{ ossFooter }}