PURISTA API / Modules / @purista/nats-config-store
Module: @purista/nats-config-store
A config store for using NATS (with JetStream) as storage. JetStream must be enabled at the NATS broker.
Example
typescript
const config = {
port: 8222
}
const store = new NatsConfigStore(config)
await store.setConfig('configKey',{ myConfig: 'value' })
let value = await store.getConfig('configKey')
console.log(value) // outputs: { configKey: { myConfig: 'value' } }
await store.removeConfig('configKey')
value = await store.getConfig('configKey')
console.log(value) // outputs: undefined
Table of contents
Classes
Type Aliases
Variables
Type Aliases
NatsConfigStoreConfig
Ƭ NatsConfigStoreConfig: Prettify
<{ keyValueStoreName
: string
} & ConnectionOptions
& Partial
<KvOptions
>>
Defined in
nats-config-store/src/types/NatsConfigStoreConfig.ts:4
Variables
puristaVersion
• Const
puristaVersion: "1.11.0"