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

1.11.0 • Public • Published

@purista/redis-state-store

A state store for using redis as storage.
State values are stored as stringified JSON in the redis database.

By default `get

 const config = {
  url: 'redis://alice:foobared@awesome.redis.server:6380'
 }

 const store = new RedisStateStore( 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/redis-state-store

Homepage

purista.dev

Weekly Downloads

80

Version

1.11.0

License

ISC

Unpacked Size

23.1 kB

Total Files

28

Last publish

Collaborators

  • sebastianwessel