Creates new persistence instance.
Unique entity type identifier
OptionalbaseDir: stringBase directory for all entities (default: ./dump/data)
Computed directory path for entity storage
ReadonlybaseReadonlyentityComputes file path for entity ID.
Entity identifier
Full file path to entity JSON file
Check if entity exists in storage.
Unique entity identifier
Promise resolving to true if exists, false otherwise
Async generator yielding all entity IDs. Sorted alphanumerically. Used internally by waitForInit for validation.
AsyncGenerator yielding entity IDs
Initialize persistence directory and validate existing files. Uses singleshot to ensure one-time execution.
Whether this is the first initialization
Promise that resolves when initialization is complete
Base class for file-based persistence with atomic writes.
Features:
Example