@nwire/store-file
v0.7.1
Published
Nwire — file-snapshot ActorStore + ProjectionStore. JSON snapshot persisted to disk with debounced writes. Survives process restart; tenant-partitioned. Dev/CI use, not production.
Readme
@nwire/store-file
File-snapshot
ActorStore+ProjectionStore— survives process restart, no DB.
What it does
Persists actor state and projection rows to a single JSON file. Writes are debounced (50 ms) to coalesce bursts; tenant-partitioned. Not a production database — @nwire/store-mongo (or future -postgres, -dynamodb) for prod. Useful for dev/CI without infrastructure.
Install
pnpm add @nwire/store-fileQuick start
import { FileSnapshotStore, FileSnapshotProjectionView } from "@nwire/store-file";
import { createApp } from "@nwire/forge";
const store = new FileSnapshotStore("./data/snapshot.json");
const projView = new FileSnapshotProjectionView(store);
const app = createApp("learnflow", {
modules,
actorStore: store,
projectionStore: projView,
});API surface
FileSnapshotStore(path)— implementsActorStore.FileSnapshotProjectionView(store)— implementsProjectionStoreagainst the same snapshot.
When to use
Dev environments without a database, CI pipelines that need persistence across test phases, tiny single-node apps.
Within nwire-app
For developers using this package as part of the Nwire stack — register it via app.use(...) or it auto-wires when you compose createApp({ modules }).
import { createApp } from "@nwire/forge";
const app = createApp({
/* ...config... */
});
// Adapter/plugin wiring happens here when applicable.