keyv-nats

0.3.0 • Public • Published

keyv-nats

NATS storage adapter for the awesome keyv.

build codecov GitHub license npm

Installation

yarn add keyv keyv-nats

Usage

import Keyv from 'keyv'
import KeyvNats from 'keyv-nats'

const keyvNats = new KeyvNats({ servers: "localhost:4222" });
await keyvNats.connect();
const keyv = new Keyv({ store: keyvNats })

const key = 'foo'
const value = 'bar'

await keyv.set(key, value)

await keyv.get(key)

keyvNats.disconnect();

Tests

NATS Keyv storage adapter uses Testcontainers for NodeJS in order to run NATS server during test automation. Please check general Docker requirements of Testcontainers to run those in your local docker environment.

# nothing else required as testcontainer will start and stop nats
yarn test

Readme

Keywords

Package Sidebar

Install

npm i keyv-nats

Weekly Downloads

23

Version

0.3.0

License

MIT

Unpacked Size

22.4 kB

Total Files

11

Last publish

Collaborators

  • gabel