{"_id":"@criistianlevrero/next-datalayer-sync","name":"@criistianlevrero/next-datalayer-sync","dist-tags":{"latest":"0.3.0"},"versions":{"0.3.0":{"name":"@criistianlevrero/next-datalayer-sync","version":"0.3.0","description":"Diffs and syncs canonical entities between Directus and local JSON, with a dry-run planner and the ndl-sync CLI.","keywords":["cmsir","directus","sync","cli","data-layer"],"license":"MIT","author":{"name":"Cristian Levriero","email":"cristianlevrero@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/criistianlevrero/cmsIR-to-next-datalayer.git","directory":"packages/sync"},"type":"module","main":"dist/index.js","types":"dist/index.d.ts","bin":{"ndl-sync":"bin/sync.mjs"},"publishConfig":{"access":"public"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","prepublishOnly":"npm run build","test:unit":"npm run build && node --test test/**/*.test.mjs"},"dependencies":{"@criistianlevrero/next-datalayer-core":"0.2.0","@criistianlevrero/next-datalayer-adapter-directus":"0.2.0","@criistianlevrero/next-datalayer-adapter-local":"0.2.0"},"devDependencies":{"typescript":"^5.5.0"},"gitHead":"6b9c39a9d1f88ce8b5df85b99bdc2a80b86845af","_id":"@criistianlevrero/next-datalayer-sync@0.3.0","bugs":{"url":"https://github.com/criistianlevrero/cmsIR-to-next-datalayer/issues"},"homepage":"https://github.com/criistianlevrero/cmsIR-to-next-datalayer#readme","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-kpRhbbe0OaMd297IJ9dfTLY0vgnUy4gr4cuzwC9cfJ8jdeSfiEJSsRGevfx09lO/6DMG/aGjZcD5/BgBfmGBsg==","shasum":"8422f0e47ebb4ae00351ded2a6fbd725ed36cff4","tarball":"https://registry.npmjs.org/@criistianlevrero/next-datalayer-sync/-/next-datalayer-sync-0.3.0.tgz","fileCount":24,"unpackedSize":101729,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDVw56AEHMZXUgWXmCikmZ9dvwGQmg0XZtHDn15EjdR3AiAVvWrsskFPXVMLFCi3wMRTFMxbu+eySYj5jThOfBISCg=="}]},"_npmUser":{"name":"cristianlevrero","email":"cristianlevrero@gmail.com"},"directories":{},"maintainers":[{"name":"cristianlevrero","email":"cristianlevrero@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/next-datalayer-sync_0.3.0_1788230895823_0.9924542723294842"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-01T02:48:15.646Z","0.3.0":"2026-09-01T02:48:15.977Z","modified":"2026-09-01T02:48:16.219Z"},"maintainers":[{"name":"cristianlevrero","email":"cristianlevrero@gmail.com"}],"description":"Diffs and syncs canonical entities between Directus and local JSON, with a dry-run planner and the ndl-sync CLI.","homepage":"https://github.com/criistianlevrero/cmsIR-to-next-datalayer#readme","keywords":["cmsir","directus","sync","cli","data-layer"],"repository":{"type":"git","url":"git+https://github.com/criistianlevrero/cmsIR-to-next-datalayer.git","directory":"packages/sync"},"author":{"name":"Cristian Levriero","email":"cristianlevrero@gmail.com"},"bugs":{"url":"https://github.com/criistianlevrero/cmsIR-to-next-datalayer/issues"},"license":"MIT","readme":"# @criistianlevrero/next-datalayer-sync\n\nDiffs and syncs canonical entities between Directus and local JSON. Ships a\nplanner you can inspect before anything is written, plus the `ndl-sync` CLI.\n\n## Install\n\n```bash\nnpm install @criistianlevrero/next-datalayer-sync\n```\n\n## CLI\n\n```bash\nexport DIRECTUS_BASE_URL=http://localhost:8055\nexport DIRECTUS_TOKEN=…\n\nDIR=diff-only ndl-sync              # report differences, write nothing\nDRY_RUN=1 ndl-sync directus-to-local # plan the writes without applying them\nndl-sync directus-to-local\nndl-sync local-to-directus\n```\n\nEntities are matched by primary key by default. To match on a business key\ninstead, set `SYNC_IDENTITY_FIELDS`:\n\n```bash\nSYNC_IDENTITY_FIELDS='page:slug,author:display_name' ndl-sync directus-to-local\n```\n\n## Library\n\n```ts\nimport { SyncEngine, buildSyncPlan, diffCollection, fingerprint } from \"@criistianlevrero/next-datalayer-sync\";\n```\n\n`fingerprint` gives a stable content hash per entity, so unchanged records are\nskipped rather than rewritten.\n\n## Run the diff first\n\n`DIR=diff-only` and `DRY_RUN=1` exist because a sync is destructive on the\ntarget side. Use them before every real run against data you care about.\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-74de463c1283e45543e8f6a28d79136d"}