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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.3.0
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.3.0
    4
  • 0.2.0
    2
  • 0.1.0
    1
  • 0.0.1
    1

Package Sidebar

Install

npm i keyv-nats

Weekly Downloads

8

Version

0.3.0

License

MIT

Unpacked Size

22.4 kB

Total Files

11

Last publish

Collaborators

  • gabel