{"_id":"@emdzej/csfs-fsa","_rev":"4-792a05fbf61e8f5842ed71ae393d6899","name":"@emdzej/csfs-fsa","dist-tags":{"latest":"0.3.0"},"versions":{"0.1.0":{"name":"@emdzej/csfs-fsa","version":"0.1.0","keywords":["filesystem","browser","zip","range-requests","opfs","file-system-access","http"],"license":"MIT","_id":"@emdzej/csfs-fsa@0.1.0","maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"homepage":"https://github.com/emdzej/csfs/tree/main/packages/fsa#readme","bugs":{"url":"https://github.com/emdzej/csfs/issues"},"dist":{"shasum":"4bfafa63706ca8858c4d3815db74bbf14138c4a6","tarball":"https://registry.npmjs.org/@emdzej/csfs-fsa/-/csfs-fsa-0.1.0.tgz","fileCount":7,"integrity":"sha512-tK6YaxTvD9hMwyCNuismHC3E+XaRmLTJTDwZ48ooxmLwxl7AV12yxFYqNs54kBW1HoDBf/z+Lf6FS5Z8+kCeJA==","signatures":[{"sig":"MEYCIQCjiNn8HfAS2q4Yd4v2vM+MsMb5pWQn3SPNcex1PpEeVgIhANf3T5xFitSeYRFaM44kJ1OCojf4j3Ayq2OToOZFjLrQ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27667},"main":"dist/index.js","type":"module","_from":"file:emdzej-csfs-fsa-0.1.0.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -b","clean":"rm -rf dist .turbo *.tsbuildinfo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"emdzej","email":"michal@jaskolski.pro"},"_resolved":"/private/var/folders/7h/x_w_580x4s9dq3sq11tpvzkwy3nbj8/T/5578ec58826c1993a85b48dc2ce59f6d/emdzej-csfs-fsa-0.1.0.tgz","_integrity":"sha512-tK6YaxTvD9hMwyCNuismHC3E+XaRmLTJTDwZ48ooxmLwxl7AV12yxFYqNs54kBW1HoDBf/z+Lf6FS5Z8+kCeJA==","repository":{"url":"git+https://github.com/emdzej/csfs.git","type":"git","directory":"packages/fsa"},"_npmVersion":"11.16.0","description":"File system over a picked directory (File System Access API)","directories":{},"_nodeVersion":"22.22.1","dependencies":{"@emdzej/csfs-core":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.13.1"},"_npmOperationalInternal":{"tmp":"tmp/csfs-fsa_0.1.0_1788549000949_0.7336539641042228","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@emdzej/csfs-fsa","version":"0.1.1","keywords":["filesystem","browser","zip","range-requests","opfs","file-system-access","http"],"license":"MIT","_id":"@emdzej/csfs-fsa@0.1.1","maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"homepage":"https://github.com/emdzej/csfs/tree/main/packages/fsa#readme","bugs":{"url":"https://github.com/emdzej/csfs/issues"},"dist":{"shasum":"4f94e79d84329a294609ff9b1723d6fc767d0793","tarball":"https://registry.npmjs.org/@emdzej/csfs-fsa/-/csfs-fsa-0.1.1.tgz","fileCount":15,"integrity":"sha512-eSojxueo2gU3txIQusDc7LknuzdJIBWSj/FRgsGcluUXrWh5bemfevrTvv4e+STtmGMGn9KRNwQjWm+5bvYPDw==","signatures":[{"sig":"MEUCIQCJobqJR0gU9WU8GdY0s45DElgDnziQ/u/79hxi1FgcZgIgYj7wclxhe/VZKa73W6JHCxtQEh3k2+SM0tFOzv70R94=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":47623},"main":"dist/index.js","type":"module","_from":"file:emdzej-csfs-fsa-0.1.1.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -b","clean":"rm -rf dist .turbo *.tsbuildinfo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"emdzej","email":"michal@jaskolski.pro"},"_resolved":"/private/var/folders/7h/x_w_580x4s9dq3sq11tpvzkwy3nbj8/T/c1180ae2728ed17aa9cd5935a1f241e4/emdzej-csfs-fsa-0.1.1.tgz","_integrity":"sha512-eSojxueo2gU3txIQusDc7LknuzdJIBWSj/FRgsGcluUXrWh5bemfevrTvv4e+STtmGMGn9KRNwQjWm+5bvYPDw==","repository":{"url":"git+https://github.com/emdzej/csfs.git","type":"git","directory":"packages/fsa"},"_npmVersion":"11.16.0","description":"File system over a picked directory (File System Access API)","directories":{},"_nodeVersion":"22.22.1","dependencies":{"@emdzej/csfs-core":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.13.1"},"_npmOperationalInternal":{"tmp":"tmp/csfs-fsa_0.1.1_1788968562675_0.9751841548717841","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@emdzej/csfs-fsa","version":"0.2.0","keywords":["filesystem","browser","zip","range-requests","opfs","file-system-access","http"],"license":"MIT","_id":"@emdzej/csfs-fsa@0.2.0","maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"homepage":"https://github.com/emdzej/csfs/tree/main/packages/fsa#readme","bugs":{"url":"https://github.com/emdzej/csfs/issues"},"dist":{"shasum":"a185260bf9604c5b2f3460b0b4af6968bae7f571","tarball":"https://registry.npmjs.org/@emdzej/csfs-fsa/-/csfs-fsa-0.2.0.tgz","fileCount":15,"integrity":"sha512-92T7mg+4c8IA0mNStItD0mtD2NA2HKcLtx1g6NrlylMtoPMAgB4G0hYjonhGOvkwirqRS7nCdbi0G0AF7EkIuw==","signatures":[{"sig":"MEUCIG6T6QED1/YEFqzO+8Tb/r6PBqY90AFjGtrEHz5C+WwmAiEAySb8oe5Q1kyz1fOGSzY/ARzb1hbRkAqehf018DYQA/8=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIG1MEl5fNbfuDEYWkFYkTML2s0ubFWazhby90fxR9qDKAiBsCPSbtD3+t43PHOkuIg71VhJ4GkOXaAfbVs2RwCskqQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":57437},"main":"dist/index.js","type":"module","_from":"file:emdzej-csfs-fsa-0.2.0.tgz","types":"dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"scripts":{"build":"tsc -b","clean":"rm -rf dist .turbo *.tsbuildinfo","typecheck":"tsc --noEmit"},"_npmUser":{"name":"emdzej","email":"michal@jaskolski.pro"},"_resolved":"/private/var/folders/7h/x_w_580x4s9dq3sq11tpvzkwy3nbj8/T/dcb5f157d0400bc5288f320c58995172/emdzej-csfs-fsa-0.2.0.tgz","_integrity":"sha512-92T7mg+4c8IA0mNStItD0mtD2NA2HKcLtx1g6NrlylMtoPMAgB4G0hYjonhGOvkwirqRS7nCdbi0G0AF7EkIuw==","repository":{"url":"git+https://github.com/emdzej/csfs.git","type":"git","directory":"packages/fsa"},"_npmVersion":"11.16.0","description":"File system over a picked directory (File System Access API)","directories":{},"_nodeVersion":"22.22.1","dependencies":{"@emdzej/csfs-core":"0.2.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.13.1"},"_npmOperationalInternal":{"tmp":"tmp/csfs-fsa_0.2.0_1789548559766_0.37734320411605027","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"_id":"@emdzej/csfs-fsa@0.3.0","bugs":{"url":"https://github.com/emdzej/csfs/issues"},"dist":{"shasum":"86c7bd472b22f605a15b4168e90ea730e4f40a76","tarball":"https://registry.npmjs.org/@emdzej/csfs-fsa/-/csfs-fsa-0.3.0.tgz","fileCount":7,"integrity":"sha512-qw786ifR/N0nF8txCRk9Z4bb0k6VRbMiA9zWThXQjBtUP/wupkklOJcPtihRKUhxrqcDP0t4cAX1ta+kquKKTA==","signatures":[{"sig":"MEQCIAIpJr+9KGH1rceJPZ8qSjGJXvQLhBM9YT7RdTvMiEpPAiBxz/KzMGY/FuFabaW1AqcGIL3ivl6oxsiSVejTZIj94w==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQC4MbRbC+/oaxiU/EyogjyQl/P1zFfUAz5uszXTm5zAWwIgfAlBIwVb6b0a+P8h9cGm3D98KKUgu1eo4pVtEDeJJSg="}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@emdzej%2fcsfs-fsa@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":60842},"main":"dist/index.js","name":"@emdzej/csfs-fsa","type":"module","_from":"file:dist-npm/emdzej-csfs-fsa-0.3.0.tgz","types":"dist/index.d.ts","engines":{"node":">=22"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./package.json":"./package.json"},"license":"MIT","scripts":{"build":"tsc -b","clean":"rm -rf dist .turbo *.tsbuildinfo","typecheck":"tsc --noEmit"},"version":"0.3.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:bcd49ab3-2b80-486b-9335-3d601453a0c5"}},"homepage":"https://github.com/emdzej/csfs/tree/main/packages/fsa#readme","keywords":["filesystem","browser","zip","range-requests","opfs","file-system-access","http"],"_resolved":"/home/runner/work/csfs/csfs/dist-npm/emdzej-csfs-fsa-0.3.0.tgz","_integrity":"sha512-qw786ifR/N0nF8txCRk9Z4bb0k6VRbMiA9zWThXQjBtUP/wupkklOJcPtihRKUhxrqcDP0t4cAX1ta+kquKKTA==","repository":{"url":"git+https://github.com/emdzej/csfs.git","type":"git","directory":"packages/fsa"},"_npmVersion":"11.20.0","description":"File system over a picked directory (File System Access API)","directories":{},"maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"sideEffects":false,"_nodeVersion":"24.21.0","dependencies":{"@emdzej/csfs-core":"0.3.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@types/node":"^22.20.4","@zip.js/zip.js":"^2.18.2","@emdzej/csfs-zip":"0.3.0","@emdzej/csfs-node":"0.3.0"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/csfs-fsa_0.3.0_1790326378802_0.07236542456877193"}}},"time":{"created":"2026-09-04T19:10:00.821Z","modified":"2026-09-25T08:52:59.424Z","0.1.0":"2026-09-04T19:10:01.082Z","0.1.1":"2026-09-09T15:42:42.848Z","0.2.0":"2026-09-16T08:49:19.846Z","0.3.0":"2026-09-25T08:52:58.878Z"},"bugs":{"url":"https://github.com/emdzej/csfs/issues"},"license":"MIT","homepage":"https://github.com/emdzej/csfs/tree/main/packages/fsa#readme","keywords":["filesystem","browser","zip","range-requests","opfs","file-system-access","http"],"repository":{"url":"git+https://github.com/emdzej/csfs.git","type":"git","directory":"packages/fsa"},"description":"File system over a picked directory (File System Access API)","maintainers":[{"name":"emdzej","email":"michal@jaskolski.pro"}],"readme":"# @emdzej/csfs-fsa\n\nA directory the user picked, as a csfs file system. File System Access API,\nso Chromium-only.\n\n_Part of [csfs](https://github.com/emdzej/csfs) — a **c**lient **s**ide **f**ile **s**ystem: one read API over static HTTP, a picked directory,\nOPFS, and inside zip archives._\n\n```ts\nimport { pickDirectory, fsaFileSystem, isFsaSupported } from \"@emdzej/csfs-fsa\";\n\nif (isFsaSupported()) {\n  const handle = await pickDirectory(\"read\");\n  const fs = fsaFileSystem(handle);\n  await fs.read(\"/pr/index.dat\");\n}\n```\n\nReads are backed by real `File` objects, so slicing costs nothing and never\ntouches the network. Writable if you ask for `\"readwrite\"`.\n\n## Two things that will bite you\n\n**Permission does not survive a reload.** A handle can be stored in IndexedDB\nand comes back intact, but `queryPermission` reports `\"prompt\"` afterwards, and\n`requestPermission` only works inside a user gesture. So a remembered directory\nneeds one click — it cannot be re-granted on boot. `queryAccess` and\n`requestAccess` let you tell that apart from a real failure, which is the\ndifference between showing a button and showing an error:\n\n```ts\nif (!(await queryAccess(handle))) {\n  // inside a click handler, not on load\n  if (!(await requestAccess(handle))) return showPicker();\n}\n```\n\nIf you want no prompt at all, import into\n[`@emdzej/csfs-opfs`](https://www.npmjs.com/package/@emdzej/csfs-opfs) instead.\n\n**There is no path lookup in the API.** Only \"get a child of this directory\", so\neach path segment is a round trip. Resolved directories are cached, which makes\nthe second read from a deep directory much cheaper than the first.\n\nWriting also stages to a temporary file and swaps on close, so write traffic\nroughly doubles. OPFS can avoid that with `createSyncAccessHandle` in a worker.\n\n## Picking a zip instead\n\n```ts\nimport { pickArchive } from \"@emdzej/csfs-fsa\";\nimport { withArchives, zipFromBlob } from \"@emdzej/csfs-zip\";\n\nconst fs = withArchives(zipFromBlob(await pickArchive()));\n```\n\nFor browsers without the pickers, `<input type=\"file\">` works everywhere — a\npicked `File` is a `Blob`, which is all `zipFromBlob` asks for.\n\n## Licence\n\n**MIT** — see [LICENSE](https://github.com/emdzej/csfs/blob/main/LICENSE).\n","readmeFilename":"README.md"}