@purista/nats-state-store
TypeScript icon, indicating that this package has built-in type declarations

1.11.0 • Public • Published

@purista/nats-state-store

A state store for using NATS (with JetStream) as storage.

const config = {
  port: 8222
}

const store = new NatsStateStore(config)

await store.setState('stateKey',{ myState: 'value' })

let value = await store.getState('stateKey')
console.log(value) // outputs: { stateKey: { myState: 'value' } }

await store.removeState('stateKey')

value = await store.getState('stateKey')
console.log(value) // outputs: undefined

See documentation of underlaying redis lib package for detailed configuration options - NODE-REDIS.

Visit purista.dev

Follow on Twitter @purista_js
Join the Discord Chat

PURISTA - Typescript framework for IoT, microservices, and serverless | Product Hunt

Readme

Keywords

none

Package Sidebar

Install

npm i @purista/nats-state-store

Homepage

purista.dev

Weekly Downloads

100

Version

1.11.0

License

ISC

Unpacked Size

20.7 kB

Total Files

34

Last publish

Collaborators

  • sebastianwessel