{"_id":"@anymux/union","name":"@anymux/union","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@anymux/union","version":"0.1.0","type":"module","license":"MIT","description":"Union file system that merges multiple file systems into one","keywords":["anymux","filesystem","union","overlay","merge"],"repository":{"type":"git","url":"git+https://github.com/AnyMux/AnyMuxMonorepo.git","directory":"packages/union"},"homepage":"https://github.com/AnyMux/AnyMuxMonorepo/tree/main/packages/union#readme","engines":{"node":">=20"},"main":"./src/index.ts","types":"./src/index.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"dependencies":{"zod":"^3.24.1","@anymux/file-system":"0.1.0"},"devDependencies":{"@types/node":"^22.10.2","tsdown":"^0.10.2","typescript":"^5.7.3","vitest":"^3.0.4","@anymux/typescript-config":"0.0.0"},"scripts":{"build":"tsdown","check":"tsc -p tsconfig.json --noEmit"},"_id":"@anymux/union@0.1.0","bugs":{"url":"https://github.com/AnyMux/AnyMuxMonorepo/issues"},"_integrity":"sha512-8nqxlDovObOK1Sp8pr1lB/ugSyna8T1NOotwFEDM8Nw/hR8lHBuR64Rjc5SMI2Xuh+QN7T/r0O2OfWdDQIkJgw==","_resolved":"/tmp/d05c29f120d6a2366ab760ecb86a1164/anymux-union-0.1.0.tgz","_from":"file:anymux-union-0.1.0.tgz","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-8nqxlDovObOK1Sp8pr1lB/ugSyna8T1NOotwFEDM8Nw/hR8lHBuR64Rjc5SMI2Xuh+QN7T/r0O2OfWdDQIkJgw==","shasum":"596dc4ba211f7b3c3bbc147bce2507e0e18c7591","tarball":"https://registry.npmjs.org/@anymux/union/-/union-0.1.0.tgz","fileCount":10,"unpackedSize":67215,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCIaALnIMmgWbB93nLS/jxOn+9xCzmDSomElSkAIrmVKgIhAOfscrcB8XfW6F5bXM/4tU+mkFvRgXWy/jv2vCwUD6Nv"}]},"_npmUser":{"name":"yatsyk","email":"yatsyk@gmail.com"},"directories":{},"maintainers":[{"name":"yatsyk","email":"yatsyk@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/union_0.1.0_1774335415878_0.3923345021858011"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-24T06:56:55.773Z","0.1.0":"2026-03-24T06:56:56.029Z","modified":"2026-03-24T06:56:56.288Z"},"maintainers":[{"name":"yatsyk","email":"yatsyk@gmail.com"}],"description":"Union file system that merges multiple file systems into one","homepage":"https://github.com/AnyMux/AnyMuxMonorepo/tree/main/packages/union#readme","keywords":["anymux","filesystem","union","overlay","merge"],"repository":{"type":"git","url":"git+https://github.com/AnyMux/AnyMuxMonorepo.git","directory":"packages/union"},"bugs":{"url":"https://github.com/AnyMux/AnyMuxMonorepo/issues"},"license":"MIT","readme":"# @anymux/union\n\nUnion/overlay file system for AnyMux. Layer multiple file systems with configurable read/write precedence.\n\n## Installation\n\n```bash\npnpm add @anymux/union\n```\n\n## Usage\n\n```typescript\nimport { UnionFileSystem } from \"@anymux/union\";\nimport { MemoryFileSystem } from \"@anymux/file-system/mem-fs\";\n\nconst base = new MemoryFileSystem();\nconst overlay = new MemoryFileSystem();\n\n// Writes go to overlay; reads check overlay first, then base\nconst fs = new UnionFileSystem([\n  { fs: overlay, writable: true },\n  { fs: base, writable: false },\n]);\n\nawait base.writeFile(\"/config.txt\", \"default\");\nawait fs.writeFile(\"/config.txt\", \"custom\"); // written to overlay\n\nconst content = await fs.readFile(\"/config.txt\", \"utf-8\"); // \"custom\"\n```\n\n## API Overview\n\nImplements `IFileSystem` by composing multiple file systems into a layered stack.\n\n- **Read operations** — search layers top-to-bottom, return first match\n- **Write operations** — directed to the first writable layer\n- **Directory listings** — merged across all layers, deduplicating entries\n- Copy-on-write semantics when modifying files from read-only layers\n\n## License\n\nMIT\n","readmeFilename":"README.md","_rev":"1-e76b46f0b0bd76f883356a429bf241d9"}