Memory Database
A volatile, in-memory storage provider for Moonlink.js. Data is lost when the process restarts.
The Memory database provider is a simple, non-persistent storage implementation. It conforms to the database interface but performs no actual storage operations, effectively acting as a "no-op" or ephemeral cache. It is the default if no database is configured.
Methods
init(manager, options)
init(manager, options)#
→Promise<void>Initializes the memory provider (No-op).
managerManager required
The Moonlink Manager instance.
optionsobject
Optional configuration.
get(key)
Always returns undefined as this provider does not persist data.
keystring required
The key to retrieve.
set(key, value)
set(key, value)#
→Promise<void>No-op. Does not store the value.
keystring required
The key to store.
valueany required
The value to store.
has(key)
remove(key)
remove(key)#
→Promise<boolean>Always returns false.
keystring required
The key to remove.
keys(pattern)
keys(pattern)#
→Promise<string[]>Always returns an empty array.
patternstring
Optional pattern.
clear()
shutdown()
shutdown()#
→Promise<void>No-op.
Local Database
A built-in, file-based persistence layer for Moonlink.js. It stores data in JSON format with Write-Ahead Logging (WAL) for durability.
WebSocket
A custom WebSocket implementation that unifies behavior across Node.js and Bun environments, featuring automatic heartbeats and latency tracking.