{"_id":"@absolutejs/sync-yjs","_rev":"6-9d9dd1afd1aed2c6f8608d9fbec51e26","name":"@absolutejs/sync-yjs","dist-tags":{"latest":"0.1.0"},"versions":{"0.0.1":{"name":"@absolutejs/sync-yjs","version":"0.0.1","keywords":["absolutejs","sync","crdt","yjs","collaborative","multiplayer"],"author":"Alex Kahn","license":"CC BY-NC 4.0","_id":"@absolutejs/sync-yjs@0.0.1","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"dist":{"shasum":"581c7b80a85f852995b4161736452cdb8a3cfdc1","tarball":"https://registry.npmjs.org/@absolutejs/sync-yjs/-/sync-yjs-0.0.1.tgz","fileCount":5,"integrity":"sha512-2ucVf9YEz61/nvIzk1ahyuVsC6YJax2i/LU/C+yOWesa2j5LjgXVbN62/cEpofSDNYj7IqJzWQJHeAyFSwR0Ag==","signatures":[{"sig":"MEYCIQCvwq+BqW9OCN0nxiQHzhK5jP7H0zNX+ixQDUiR8FFAAQIhAPyD8ZGe+B8yQOdx+Sdyc0JY1azP4CkMDM/Xh+XJFpxY","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14296},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"581c7b80a85f852995b4161736452cdb8a3cfdc1","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync --external yjs && tsc --project tsconfig.build.json","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run build && bun publish","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-2ucVf9YEz61/nvIzk1ahyuVsC6YJax2i/LU/C+yOWesa2j5LjgXVbN62/cEpofSDNYj7IqJzWQJHeAyFSwR0Ag==","repository":{"url":"https://github.com/absolutejs/sync-adapters.git","type":"git","directory":"yjs"},"_npmVersion":"10.8.3","description":"Yjs-backed collaborative-text CRDT adapter for @absolutejs/sync","directories":{},"_nodeVersion":"24.3.0","dependencies":{"yjs":"^13.6.30"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.5.3","@types/bun":"1.3.14","typescript":"5.8.3","@absolutejs/sync":"^0.10.0"},"peerDependencies":{"@absolutejs/sync":">= 0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/sync-yjs_0.0.1_1779751186579_0.7918129699517569","host":"s3://npm-registry-packages-npm-production"}},"0.0.2":{"name":"@absolutejs/sync-yjs","version":"0.0.2","keywords":["absolutejs","sync","crdt","yjs","collaborative","multiplayer"],"author":"Alex Kahn","license":"CC BY-NC 4.0","_id":"@absolutejs/sync-yjs@0.0.2","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"dist":{"shasum":"f37c32f9bcf4d1d7b88293d98a74d977640e9b20","tarball":"https://registry.npmjs.org/@absolutejs/sync-yjs/-/sync-yjs-0.0.2.tgz","fileCount":5,"integrity":"sha512-XiugCz83S32GGgzyEcH4aYKh4V+PYSLOe6Xc0pbjpT0vDJxnP3Vs0jm5JCTcImXZ31Rz4ZuMr91iJKuFgIc4FQ==","signatures":[{"sig":"MEUCIQDWJbTEKOqlJZBYyutM+roes8c94ri7kJmVGv/d7gx65gIgWaOJNU5Wiu4lvcpNTZQEROhnX/eNGyvnIElxqOtnWqY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15276},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"f37c32f9bcf4d1d7b88293d98a74d977640e9b20","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync --external yjs && tsc --project tsconfig.build.json","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run build && bun publish","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-XiugCz83S32GGgzyEcH4aYKh4V+PYSLOe6Xc0pbjpT0vDJxnP3Vs0jm5JCTcImXZ31Rz4ZuMr91iJKuFgIc4FQ==","repository":{"url":"https://github.com/absolutejs/sync-adapters.git","type":"git","directory":"yjs"},"_npmVersion":"10.8.3","description":"Yjs-backed collaborative-text CRDT adapter for @absolutejs/sync","directories":{},"_nodeVersion":"24.3.0","dependencies":{"yjs":"^13.6.30"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.5.3","@types/bun":"1.3.14","typescript":"5.8.3","@absolutejs/sync":"^1.0.0"},"peerDependencies":{"@absolutejs/sync":">= 0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/sync-yjs_0.0.2_1779768550497_0.6384732264997837","host":"s3://npm-registry-packages-npm-production"}},"0.0.3":{"name":"@absolutejs/sync-yjs","version":"0.0.3","keywords":["absolutejs","sync","crdt","yjs","collaborative","multiplayer"],"author":"Alex Kahn","license":"Apache-2.0","_id":"@absolutejs/sync-yjs@0.0.3","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"dist":{"shasum":"a1c698676015ececcd5e3d52f590cd9ae20244db","tarball":"https://registry.npmjs.org/@absolutejs/sync-yjs/-/sync-yjs-0.0.3.tgz","fileCount":6,"integrity":"sha512-MfhPeb2H3f3BiUz/L3P3QD828Snl2xkjm33jdXWuNWp93sb9y94rNlWceQC5Nzc8Wu6+8TZmpK3iiYMTaXBz0A==","signatures":[{"sig":"MEUCIQCWSjLi3A8i6P2eoT/4M9kFlD7q3qDV2IN49RN6Iici3wIgQ+XIzrStBf7zzBz/XLnZNxAy+KYQi3dAUvcqJaKCSPo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":26632},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"a1c698676015ececcd5e3d52f590cd9ae20244db","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync --external yjs && tsc --project tsconfig.build.json","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run build && bun publish","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-MfhPeb2H3f3BiUz/L3P3QD828Snl2xkjm33jdXWuNWp93sb9y94rNlWceQC5Nzc8Wu6+8TZmpK3iiYMTaXBz0A==","repository":{"url":"https://github.com/absolutejs/sync-adapters.git","type":"git","directory":"yjs"},"_npmVersion":"10.8.3","description":"Yjs-backed collaborative-text CRDT adapter for @absolutejs/sync","directories":{},"_nodeVersion":"24.3.0","dependencies":{"yjs":"^13.6.30"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.5.3","@types/bun":"1.3.14","typescript":"5.8.3","@absolutejs/sync":"^1.0.0"},"peerDependencies":{"@absolutejs/sync":">= 0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/sync-yjs_0.0.3_1780071589045_0.6840874863559525","host":"s3://npm-registry-packages-npm-production"}},"0.0.4":{"name":"@absolutejs/sync-yjs","version":"0.0.4","keywords":["absolutejs","sync","crdt","yjs","collaborative","multiplayer"],"author":"Alex Kahn","license":"Apache-2.0","_id":"@absolutejs/sync-yjs@0.0.4","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/sync-adapters/tree/main/yjs","bugs":{"url":"https://github.com/absolutejs/sync-adapters/issues"},"dist":{"shasum":"302a5300ae50d912a370e42ef607632cfd264ae6","tarball":"https://registry.npmjs.org/@absolutejs/sync-yjs/-/sync-yjs-0.0.4.tgz","fileCount":10,"integrity":"sha512-AUgSbK+pjPtKBLvvgnyMVtyndoV0xLr6cWpBrqCZsTESdTHWTzVxd8nKVv2SoQi9USzdvYuEOrlVFH77HgpGFw==","signatures":[{"sig":"MEYCIQCW7/y4SUcn4YsvKVPoVQbFNZWP43dEkzxN/E3kxOhj2wIhAKDJZ57VlMOmnOhTNVCDDwMvZ1v+mvDy6xcqdFjGTHOg","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":1116638},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"302a5300ae50d912a370e42ef607632cfd264ae6","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync --external yjs && tsc --project tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run build && bun publish","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-AUgSbK+pjPtKBLvvgnyMVtyndoV0xLr6cWpBrqCZsTESdTHWTzVxd8nKVv2SoQi9USzdvYuEOrlVFH77HgpGFw==","absolutejs":{"manifestContract":1},"repository":{"url":"https://github.com/absolutejs/sync-adapters.git","type":"git","directory":"yjs"},"_npmVersion":"10.8.3","description":"Yjs-backed collaborative-text CRDT adapter for @absolutejs/sync","directories":{},"_nodeVersion":"24.3.0","dependencies":{"yjs":"^13.6.30","@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.5.3","@types/bun":"1.3.14","typescript":"5.8.3","@absolutejs/sync":"^1.0.0"},"peerDependencies":{"@absolutejs/sync":">= 0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/sync-yjs_0.0.4_1783965126829_0.4625490431185615","host":"s3://npm-registry-packages-npm-production"}},"0.0.5":{"name":"@absolutejs/sync-yjs","version":"0.0.5","keywords":["absolutejs","sync","crdt","yjs","collaborative","multiplayer"],"author":"Alex Kahn","license":"Apache-2.0","_id":"@absolutejs/sync-yjs@0.0.5","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"homepage":"https://github.com/absolutejs/sync-adapters/tree/main/yjs","bugs":{"url":"https://github.com/absolutejs/sync-adapters/issues"},"dist":{"shasum":"8e593c5b3f4e3437115f06bd85151d54276aa545","tarball":"https://registry.npmjs.org/@absolutejs/sync-yjs/-/sync-yjs-0.0.5.tgz","fileCount":10,"integrity":"sha512-MpLnm/ypCCXOYcbwkQFI7+/g5zZg//GZMCvTraiMr0JMTnjJ+XOByS/4FTwCg0QRvgXvPkz3XRKqrqNwzDfDjA==","signatures":[{"sig":"MEUCIQCW7B45n+76QzsUK2nFPz3uDYylZmAEnCxBzOlygzchTAIgQGhF7QLDL2ll89rxnsQ7UeF7l9p63uOHjRkxrE5HHLM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":479311},"main":"./dist/index.js","type":"module","types":"./dist/index.d.ts","module":"./dist/index.js","shasum":"8e593c5b3f4e3437115f06bd85151d54276aa545","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"scripts":{"test":"bun test","build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync --external yjs && tsc --project tsconfig.build.json && absolute-manifest emit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run build && bun publish","typecheck":"tsc --noEmit"},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"_integrity":"sha512-MpLnm/ypCCXOYcbwkQFI7+/g5zZg//GZMCvTraiMr0JMTnjJ+XOByS/4FTwCg0QRvgXvPkz3XRKqrqNwzDfDjA==","absolutejs":{"runtimePeers":{"@absolutejs/sync":{"range":">=2.11.0 <3","tested":"2.11.0","buildExternals":["@absolutejs/sync"],"artifactImports":[]}},"manifestContract":2},"repository":{"url":"https://github.com/absolutejs/sync-adapters.git","type":"git","directory":"yjs"},"_npmVersion":"10.8.3","description":"Yjs-backed collaborative-text CRDT adapter for @absolutejs/sync","directories":{},"_nodeVersion":"24.3.0","dependencies":{"yjs":"^13.6.30","@sinclair/typebox":"^0.34.0","@absolutejs/manifest":"^0.7.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"prettier":"3.5.3","@types/bun":"1.3.14","typescript":"5.8.3","@absolutejs/sync":"2.11.0"},"peerDependencies":{"@absolutejs/sync":">=2.11.0 <3"},"_npmOperationalInternal":{"tmp":"tmp/sync-yjs_0.0.5_1784913336596_0.17403551258880934","host":"s3://npm-registry-packages-npm-production"}},"0.1.0":{"name":"@absolutejs/sync-yjs","version":"0.1.0","description":"Yjs-backed collaborative-text CRDT adapter for @absolutejs/sync","repository":{"type":"git","url":"git+https://github.com/absolutejs/sync-adapters.git","directory":"yjs"},"homepage":"https://github.com/absolutejs/sync-adapters/tree/main/yjs","bugs":{"url":"https://github.com/absolutejs/sync-adapters/issues"},"main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","type":"module","license":"Apache-2.0","author":{"name":"Alex Kahn"},"publishConfig":{"access":"public"},"keywords":["absolutejs","sync","crdt","yjs","collaborative","multiplayer"],"scripts":{"build":"rm -rf dist && bun build src/index.ts src/manifest.ts --outdir dist --sourcemap --target=bun --external @absolutejs/sync --external yjs && tsc --project tsconfig.build.json && absolute-manifest emit","test":"bun test","typecheck":"tsc --noEmit","format":"prettier --write \"./**/*.{ts,json,md}\"","release":"bun run format && bun run build && bun publish"},"dependencies":{"@absolutejs/manifest":"^0.7.1","@sinclair/typebox":"^0.34.0","yjs":"^13.6.30"},"peerDependencies":{"@absolutejs/sync":">=2.11.0 <3"},"devDependencies":{"@absolutejs/sync":"2.11.0","@types/bun":"1.3.14","prettier":"3.5.3","typescript":"5.8.3"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./manifest":{"types":"./dist/manifest.d.ts","import":"./dist/manifest.js","default":"./dist/manifest.js"},"./manifest.json":"./dist/manifest.json"},"absolutejs":{"manifestContract":2,"runtimePeers":{"@absolutejs/sync":{"artifactImports":[],"buildExternals":["@absolutejs/sync"],"range":">=2.11.0 <3","tested":"2.11.0"}}},"_id":"@absolutejs/sync-yjs@0.1.0","gitHead":"1b9302ecee4b03f689cabfe665aa740cd16b08ea","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-UMQmAyiO9ytAv/sxxY8CQPWxeKElvJV02vy2Uq5LneO177a2gaLrDY3I6hAyRhmOWILyXR38AiNvZSgzpgk3Tw==","shasum":"74ff5452519311b4d4fffeaae80fabdba030a090","tarball":"https://registry.npmjs.org/@absolutejs/sync-yjs/-/sync-yjs-0.1.0.tgz","fileCount":10,"unpackedSize":480859,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQClykvASgNiXvFI6OLXm7QCtrpqe7t3zJA5vPWpQ429vQIgb3u4rmuO0IXJhP63and+afvUeqcB6hGmH9VtcbDs5as="}]},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"directories":{},"maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sync-yjs_0.1.0_1785181168154_0.09422405251710986"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-25T23:19:46.478Z","modified":"2026-07-27T19:39:28.504Z","0.0.1":"2026-05-25T23:19:46.731Z","0.0.2":"2026-05-26T04:09:10.652Z","0.0.3":"2026-05-29T16:19:49.219Z","0.0.4":"2026-07-13T17:52:06.977Z","0.0.5":"2026-07-24T17:15:36.804Z","0.1.0":"2026-07-27T19:39:28.316Z"},"bugs":{"url":"https://github.com/absolutejs/sync-adapters/issues"},"author":{"name":"Alex Kahn"},"license":"Apache-2.0","homepage":"https://github.com/absolutejs/sync-adapters/tree/main/yjs","keywords":["absolutejs","sync","crdt","yjs","collaborative","multiplayer"],"repository":{"type":"git","url":"git+https://github.com/absolutejs/sync-adapters.git","directory":"yjs"},"description":"Yjs-backed collaborative-text CRDT adapter for @absolutejs/sync","maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"readme":"# @absolutejs/sync-yjs\n\nA [Yjs](https://github.com/yjs/yjs)-backed collaborative-text CRDT for\n[`@absolutejs/sync`](https://github.com/absolutejs/sync), behind the same\n`CrdtText` / `TextCrdtAdapter` contract as the core's zero-dependency `rgaText`.\n\n`@absolutejs/sync/crdt` ships a first-party RGA text CRDT that's great for\noffline-merge and moderate collaboration. When you need production-scale\ncollaborative text — efficient deltas, no unbounded tombstone growth, the\ninterleaving guarantees the community relies on — Yjs is the staple. This adapter\nlets you swap it in without touching your call sites.\n\n## Install\n\n```bash\nbun add @absolutejs/sync-yjs yjs\n```\n\n`@absolutejs/sync` is a peer dependency (you already have it). `yjs` is a runtime\ndependency you install alongside.\n\n## Use\n\n```ts\nimport { yjsText } from '@absolutejs/sync-yjs';\n// ...instead of: import { rgaText } from '@absolutejs/sync/crdt';\n\n// Client — a live doc per replica (e.g. per tab/device)\nconst doc = yjsText.create('tab-a', initialStateFromServer);\ndoc.setText(textarea.value); // reconciles via a minimal diff\nsocket.send(doc.state()); // broadcast the serialized (base64) state\ndoc.merge(incomingState); // fold a peer's state into local edits\ndoc.text(); // the merged visible text\nconst cursor = doc.anchorAt?.(textarea.selectionStart); // stable relative cursor\ndoc.indexOfAnchor?.(cursor ?? null); // follows concurrent inserts/deletes\n\n// Server — merge-on-write so concurrent writes combine instead of clobbering\nconst next = yjsText.merge(storedState, incomingState);\n// store `next`; yjsText.textOf(next) is the plain text\n```\n\nThe serialized state is a base64 string of a Yjs update — JSON-safe for the sync\nengine's change feed and for storing as a row field. `merge` is\ncommutative/associative/idempotent, so the order writes arrive in doesn't matter.\n\n## The contract\n\nThis package implements `TextCrdtAdapter<string>` from `@absolutejs/sync/crdt`:\n\n| Member                      | What it does                                                  |\n| --------------------------- | ------------------------------------------------------------- |\n| `create(replica, initial?)` | A live `CrdtText` doc: `text/setText/merge/state`.            |\n| `merge(a, b)`               | Combine two persisted states (server-side, no live instance). |\n| `empty()`                   | The serialized state of an empty document.                    |\n| `textOf(state)`             | The plain text of a persisted state.                          |\n\n## License\n\nApache License 2.0. See [LICENSE](./LICENSE).\n","readmeFilename":"README.md"}