@bight-ts/storage-json
import { JsonStorageAdapter } from "@bight-ts/storage-json";JsonStorageAdapter
Section titled “JsonStorageAdapter”Implements StorageAdapter using a JSON file on disk.
Constructor
Section titled “Constructor”new JsonStorageAdapter({ filePath: "./data/db.json" });| Option | Type | Required | Description |
|---|---|---|---|
filePath | string | Yes | Path to the JSON file. Created automatically with parent directories. |
Behavior
Section titled “Behavior”- Reads and writes the entire file on every operation (no partial updates).
- Data structure:
{ global: Record<string, StorageValue>, guilds: Record<string, Record<string, StorageValue>> } - Suitable for local development and small bots. Not recommended for production.