Versioned document migration library for remoteStorage apps. v1.0.2 (2024). No dependencies. Documents track their own version via a configurable field (default `_migrateVersion`). When reading a document, `migrateDocument` deep-clones it and runs registered transforms in order if behind. `migrateAll` batch-migrates full collections via an adapter. Distinguishes itself from generic migration tools by being purpose-built for remoteStorage's document model (zero deps, lazy on read, eager batch optional). Ships TypeScript definitions.
npm install rs-migrateNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a migrator, registering two migrations on the 'contacts' collection, and migrating a document from version 0 to 2.
Use `createMigrator({ versionField: 'customVersion' })` to match your existing schema.If you need to modify the original, assign the result back: `doc = migrator.migrateDocument('contacts', doc)`.Ensure documents have the version field set explicitly to avoid unexpected migration.
Use a new version number (highest existing + 1) or use `registerAll` which is atomic.
Run `npm install rs-migrate` and ensure `tsconfig.json` includes `"node_modules/@types"` or the module is in `node_modules`.
Use `import { createMigrator } from 'rs-migrate'` instead of default import.Ensure version is a positive integer (>=1).
No dependency data recorded yet.