{"_id":"@aepyornis/opfs_blob_store","name":"@aepyornis/opfs_blob_store","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@aepyornis/opfs_blob_store","version":"0.0.1","description":"Store blobs in OPFS","main":"index.ts","type":"module","scripts":{"test":"open test.html","build":"esbuild --bundle index.ts --outfile=opfs_blob_store.js --target=chrome121 --format=esm --platform=browser"},"author":{"name":"Ziggy, Calyx Institute"},"license":"MIT","dependencies":{"jssha":"^3.3.1"},"prettier":{"tabWidth":2,"semi":false,"arrowParens":"avoid","printWidth":100},"_id":"@aepyornis/opfs_blob_store@0.0.1","gitHead":"09bdd6422f0771af7be8dc23e2fc11bfecf8ead6","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-23GB7puUDczsyHbvKIkuJA8Np+QjYCnwfVLirFVkAg1unvZmuYlgaH9oqIfbvVEhNFhWXCZY0FJl2xKGJpqUNA==","shasum":"6ccbafa1e4d1ced5eac807b55b64dd81832d9380","tarball":"https://registry.npmjs.org/@aepyornis/opfs_blob_store/-/opfs_blob_store-0.0.1.tgz","fileCount":4,"unpackedSize":9384,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDsUz6/jQOFxbpu2wwws2RqogobqoHA7g9a6zqIFlbs9QIhAOlXbvwxoKKq2r+Kj5glSP94Qsx6OqOCRut3yTW17ERa"}]},"_npmUser":{"name":"aepyornis","email":"ziggy@elephant-bird.net"},"directories":{},"maintainers":[{"name":"aepyornis","email":"ziggy@elephant-bird.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/opfs_blob_store_0.0.1_1744834242019_0.18293880486889003"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-16T20:10:41.961Z","0.0.1":"2025-04-16T20:10:42.204Z","modified":"2025-04-16T20:10:42.403Z"},"maintainers":[{"name":"aepyornis","email":"ziggy@elephant-bird.net"}],"description":"Store blobs in OPFS","author":{"name":"Ziggy, Calyx Institute"},"license":"MIT","readme":"store sha256 addressable data in OPFS\n\n```js\nimport OpfsBlobStore from \"opfs_blob_store\"\n\n// API\nconst bs = await OpfsBlobStore.create()\n// download, check, and store\nawait bs.fetch(hash, url, onProgress)\n// verify data\nawait bs.verify(hash, onProgress)\n// does file exists\nawait bs.has(hash)\n// retrive file from store\nawait bs.get(hash)\n// delete file from store\nawait bs.delete(hash)\n// list all data\nawait bs.keys()\n\n// how to use\n\nconst hash = \"26150972b0d5e221fe3509075d5916cd3dc4998ef219f4057cd0bd3b9e8f6c58\"\nconst url =\n  \"https://upload.wikimedia.org/wikipedia/commons/thumb/5/54/Ursus_americanus.jpg/252px-Ursus_americanus.jpg\"\nconst bs = await OpfsBlobStore.create()\nconst onProgress = ratio => `${Math.round(ratio * 100, 2)}%`\n\nawait bs.fetch(hash, url, onProgress)\nawait bs.verify(hash, onProgress)\n\nconst file = await bs.get(hash)\n```\n","readmeFilename":"README.md","_rev":"1-abab0e179a0f6e88923478105c8a0467"}