Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@iobroker/db-states-file

Package Overview
Dependencies
Maintainers
6
Versions
427
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iobroker/db-states-file

The Library contains the Database classes for File based states database client and server.

  • 7.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12K
increased by51.89%
Maintainers
6
Weekly downloads
 
Created
Source

File DB states classes for ioBroker

The Library contains the Database classes for File based states database client and server.

Redis simulator

The states db client is always a redis client, but if the database type is file, it will communicate with a built-in redis simulator instead of a real redis db.

In the js-controller we use ioredis, the library supports all redis commands by simply calling them on the client instance, like redis.set("foo", "bar"). For an explanation of the commands in native redis, we refer to the redis documentation.

Currently, the following commands are supported by the simulator for states db:

Namespaces

The simulator supports five different namespaces:

  • states (default: io.)
  • messages (default: messagebox.)
  • log (default: log.)
  • session (default: session.)
  • meta (default: meta.)

Overview

CommandState of integrationnamespace
infopartialindependent
quitfullindependent
publishfullall
mgetfullstates
getfullstates, session, meta
setfullstates, meta
setexfullstates, session
delfullstates, session
keysfullstates
psubscribefullmessages, log, states, meta
punsubscribefullmessages, log, states
subscribedummyindependent
configdummyindependent
clientpartialindependent

info

Returns infomration about the simulator.

quit

This will close the connection.

publish

On publish the server will publish to all clients who have subscribed to the states, just like redis does.

mget

mget is used to receive multiple states from the server.

get

get is used to receive a single state from the server.

set

set is used to set a state to the database.

setex

setex is used to set a state to the database which automatically expires after a given time.

del

del deletes a given state from the db.

keys

It returns all matching keys.

psubscribe

Subscribes for a pattern to receive state changes.

punsubscribe

Unsubscribes a pattern to no longer receive state changes.

subscribe

Just a dummy needed to acknowledge expiring keys.

config

Mainly a dummy, just sends a positive response if notify-keyspace-events request received.

client

Is used to handle setname and getname requests. setname is used to change the logging namespace. On getname the server will respond with the current connection name, which has been set via getname.

License

The MIT License (MIT)

Copyright (c) 2014-2024 bluefox dogafox@gmail.com, Copyright (c) 2014 hobbyquaker

Keywords

FAQs

Package last updated on 13 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc