/** * Example: Stream operations from bundles * * Usage: * bun examples/stream.ts */ import { PLCBundle } from '../src'; const bundle = new PLCBundle('./data/bundles'); console.log('Streaming operations from bundle 1...\n'); let count = 0; const dids = new Set(); for await (const op of bundle.streamOperations(1)) { count++; dids.add(op.did); // Example: Print first 10 operations if (count <= 10) { console.log(`${count}. ${op.did} - ${op.createdAt}`); } } console.log(`\n✓ Processed ${count} operations`); console.log(` Unique DIDs: ${dids.size}`);