{"_id":"@bradensbay/globals-core","_rev":"2-4cb6b0d500b4fcf65bb7a777ca7f34f4","name":"@bradensbay/globals-core","dist-tags":{"latest":"0.2.1"},"versions":{"0.2.0":{"name":"@bradensbay/globals-core","version":"0.2.0","license":"MIT","_id":"@bradensbay/globals-core@0.2.0","maintainers":[{"name":"christiangrrogers","email":"christiangrrogers@gmail.com"}],"homepage":"https://github.com/christianGRogers/globals#readme","bugs":{"url":"https://github.com/christianGRogers/globals/issues"},"dist":{"shasum":"345cc956792707d73d43658590e1dc6de571ff1a","tarball":"https://registry.npmjs.org/@bradensbay/globals-core/-/globals-core-0.2.0.tgz","fileCount":98,"integrity":"sha512-DHmAfJYvyB5w7jTGPMtjeRMqrF+Q1GHCDZICzH92uED6Czb+lutotZpmZGXAv/u59iOUnJf/u/WxRzgpzCUOYA==","signatures":[{"sig":"MEYCIQCcErFLEyBaTDSbYUUm8hZC8/D3HRqxQiwXq7+4xkCbugIhAP5AN7FQGrwgWmLeruYl08ndfUAAjKCbzTP1HnqerqDt","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bradensbay%2fglobals-core@0.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":460304},"main":"./dist/src/index.js","type":"module","types":"./dist/src/index.d.ts","engines":{"node":">=20.11.0"},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"21dd602e24b18673ff60a164f2556eb927bb6596","_npmUser":{"name":"christiangrrogers","email":"christiangrrogers@gmail.com"},"repository":{"url":"git+https://github.com/christianGRogers/globals.git","type":"git","directory":"packages/core"},"_npmVersion":"10.9.8","description":"Runtime agnostic shared memory arena: tagged value encoding, persistent data structures, epoch based reclamation.","directories":{},"sideEffects":false,"_nodeVersion":"22.23.2","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/globals-core_0.2.0_1788028650481_0.2770495668716899","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@bradensbay/globals-core","version":"0.2.1","description":"Runtime agnostic shared memory arena: tagged value encoding, persistent data structures, epoch based reclamation.","type":"module","main":"./dist/src/index.js","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"engines":{"node":">=20.11.0"},"sideEffects":false,"license":"MIT","repository":{"type":"git","url":"git+https://github.com/christianGRogers/globals.git","directory":"packages/core"},"_id":"@bradensbay/globals-core@0.2.1","gitHead":"b64920872c82a9a84c5dca28dfa39a6bee9c3983","bugs":{"url":"https://github.com/christianGRogers/globals/issues"},"homepage":"https://github.com/christianGRogers/globals#readme","_nodeVersion":"22.23.2","_npmVersion":"10.9.8","dist":{"integrity":"sha512-Pw/KiUXGV1KWeUe37X69RLPhMh7fme3OK/iTxXRXPMF3mpEy8DkO5hdPRgrVbZEDWmlaxhr58aGodAk7vqXzUg==","shasum":"ce5f41c0dd5de23eea02f29048577b8a35b33f39","tarball":"https://registry.npmjs.org/@bradensbay/globals-core/-/globals-core-0.2.1.tgz","fileCount":98,"unpackedSize":460304,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@bradensbay%2fglobals-core@0.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIFL7uiNlCin7CBbzNRlDn1XZ0RBw4zOA7o/4Dp0ZKiS7AiEA+mnHF6YuhTGXX9d4v+B8oW17CL2G/s66Owu8xpYhlFQ="}]},"_npmUser":{"name":"christiangrrogers","email":"christiangrrogers@gmail.com"},"directories":{},"maintainers":[{"name":"christiangrrogers","email":"christiangrrogers@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/globals-core_0.2.1_1788134554385_0.9449875160050143"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-29T18:37:30.339Z","modified":"2026-08-31T00:02:34.940Z","0.2.0":"2026-08-29T18:37:30.630Z","0.2.1":"2026-08-31T00:02:34.544Z"},"bugs":{"url":"https://github.com/christianGRogers/globals/issues"},"license":"MIT","homepage":"https://github.com/christianGRogers/globals#readme","repository":{"type":"git","url":"git+https://github.com/christianGRogers/globals.git","directory":"packages/core"},"description":"Runtime agnostic shared memory arena: tagged value encoding, persistent data structures, epoch based reclamation.","maintainers":[{"name":"christiangrrogers","email":"christiangrrogers@gmail.com"}],"readme":"# @bradensbay/globals-core\n\nThe runtime agnostic core of [Globals](https://github.com/christianGRogers/globals): one\nshared memory arena, a tagged value encoding, an allocator, and epoch based reclamation.\n\nNothing in this package imports Electron. That is deliberate, and it is what makes the arena\ntestable in plain Node with worker threads.\n\n## Contract\n\nReads are synchronous. Writes are asynchronous. See\n[docs/contract.md](../../docs/contract.md).\n\n## Usage\n\n```ts\nimport { ArenaOwner, ArenaReader } from \"@bradensbay/globals-core\";\n\n// In the owner, the only process that writes.\nconst owner = ArenaOwner.create({ byteLength: 1 << 20 });\nowner.commit(42);\n\n// In any process that holds the same buffer.\nconst reader = ArenaReader.attach(owner.buffer);\nreader.read(); // 42, synchronously\n\n// Hold a version across several reads so they cannot disagree.\nconst snapshot = reader.acquire();\nsnapshot.value;\nsnapshot.release();\n\nreader.detach();\n```\n\n## Writing\n\n```ts\nawait store.update((draft: State) => {\n  draft.users[3].name = \"new name\";\n});\n```\n\nOnly the paths the recipe touched are rebuilt. Setting one key of an object with ten\nthousand keys allocates fewer than twenty blocks rather than copying the record. See\n[docs/object-layer.md](../../docs/object-layer.md).\n\n## Type ladder\n\nPlain objects, arrays, `Map`, `Set`, `Date`, `RegExp`, `BigInt`, typed arrays, and the\nscalars. Anything else raises `UnencodableValueError` rather than being silently coerced,\nand reaches the asynchronous tier through `ExternalTier` if it needs to be shared at all.\n\n## Errors\n\n| Error | Meaning |\n| --- | --- |\n| `StaleSnapshotError` | The version you held was reclaimed. Reacquire. |\n| `ArenaCorruptError` | A decode found something a correct writer cannot produce. |\n| `ArenaFullError` | The arena is exhausted and cannot grow. |\n| `NoReaderSlotError` | Every reader slot is claimed. |\n| `UnencodableValueError` | The value is outside the type ladder. |\n\n## Testing\n\n```bash\nnpm test          # unit, property, and fail closed tests\nnpm run soak      # multi process soak, the release gate for arena changes\nnpm run bench     # the read latency harness\n```\n","readmeFilename":"README.md"}