{"name":"blockstore-core","version":"5.0.2","keywords":["datastore","interface","ipfs","key-value"],"author":{"name":"Alex Potsides","email":"alex.potsides@protocol.ai"},"license":"Apache-2.0 OR MIT","_id":"blockstore-core@5.0.2","maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"npm-service-account-ipfs","email":"npm-service-account+ipfs@ipfs.tech"}],"homepage":"https://github.com/ipfs/js-stores/tree/main/packages/blockstore-core#readme","bugs":{"url":"https://github.com/ipfs/js-stores/issues"},"dist":{"shasum":"c29e00bdbae121d31b5fed50e64afa549237ec9a","tarball":"http://registry-npm.ywwl.com/blockstore-core/download/blockstore-core-5.0.2.tgz","fileCount":35,"integrity":"sha512-y7/BHdYLO3YCpJMg6Ue7b4Oz4FT1HWSZoHHdlsaJTsvoE8XieXb6kUCB9UkkUBDw2x4neRDwlgYBpyK77+Ro2Q==","signatures":[{"sig":"MEUCIBLpk/coIR2GR/AxwfFnm3IOvW2BujqnlGIpVScbFdS6AiEA9XkSkZDt1dY40XVrV7Vanr64Q8kMAYYpZ7KjqrDbI64=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/blockstore-core@5.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":77822,"size":20371,"noattachment":false,"key":"/blockstore-core/-/blockstore-core-5.0.2.tgz"},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"},"./base":{"types":"./dist/src/base.d.ts","import":"./dist/src/base.js"},"./errors":{"types":"./dist/src/errors.d.ts","import":"./dist/src/errors.js"},"./memory":{"types":"./dist/src/memory.d.ts","import":"./dist/src/memory.js"},"./tiered":{"types":"./dist/src/tiered.d.ts","import":"./dist/src/tiered.js"},"./identity":{"types":"./dist/src/identity.d.ts","import":"./dist/src/identity.js"},"./black-hole":{"types":"./dist/src/black-hole.d.ts","import":"./dist/src/black-hole.js"}},"gitHead":"252df284e69a632a29f627997f333644be6efc5f","release":{"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"release":"major","breaking":true},{"revert":true,"release":"patch"},{"type":"feat","release":"minor"},{"type":"fix","release":"patch"},{"type":"docs","release":"patch"},{"type":"test","release":"patch"},{"type":"deps","release":"patch"},{"scope":"no-release","release":false}]}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits","presetConfig":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Trivial Changes"},{"type":"docs","section":"Documentation"},{"type":"deps","section":"Dependencies"},{"type":"test","section":"Tests"}]}}],"@semantic-release/changelog","@semantic-release/npm","@semantic-release/github","@semantic-release/git"],"branches":["main"]},"scripts":{"lint":"aegir lint","test":"aegir test -t node -t browser -t webworker -t electron-main","build":"aegir build","clean":"aegir clean","release":"aegir release","dep-check":"aegir dep-check","test:node":"aegir test -t node --cov","test:chrome":"aegir test -t browser --cov","test:firefox":"aegir test -t browser -- --browser firefox","test:electron-main":"aegir test -t electron-main","test:chrome-webworker":"aegir test -t webworker","test:firefox-webworker":"aegir test -t webworker -- --browser firefox"},"_npmUser":{"name":"npm-service-account-ipfs","email":"npm-service-account+ipfs@ipfs.tech"},"repository":{"url":"git+https://github.com/ipfs/js-stores.git","type":"git"},"_npmVersion":"10.8.3","description":"Contains various implementations of the API contract described in interface-blockstore","directories":{},"_nodeVersion":"20.17.0","dependencies":{"it-drain":"^3.0.7","it-merge":"^3.0.5","it-filter":"^3.1.1","it-pushable":"^3.2.3","multiformats":"^13.2.3","@libp2p/logger":"^5.0.1","interface-store":"^6.0.0","interface-blockstore":"^5.0.0"},"eslintConfig":{"extends":"ipfs","parserOptions":{"project":true,"sourceType":"module"}},"publishConfig":{"access":"public","provenance":true},"typesVersions":{"*":{"*":["*","dist/*","dist/src/*","dist/src/*/index"],"src/*":["*","dist/*","dist/src/*","dist/src/*/index"]}},"_hasShrinkwrap":false,"devDependencies":{"aegir":"^44.1.1","it-all":"^3.0.6","uint8arrays":"^5.1.0","interface-blockstore-tests":"^7.0.0"},"_npmOperationalInternal":{"tmp":"tmp/blockstore-core_5.0.2_1726237701023_0.021411941205670137","host":"s3://npm-registry-packages"},"readme":"# blockstore-core\n\n[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)\n[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)\n[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-stores.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-stores)\n[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/js-stores/js-test-and-release.yml?branch=main\\&style=flat-square)](https://github.com/ipfs/js-stores/actions/workflows/js-test-and-release.yml?query=branch%3Amain)\n\n> Contains various implementations of the API contract described in interface-blockstore\n\n# About\n\n<!--\n\n!IMPORTANT!\n\nEverything in this README between \"# About\" and \"# Install\" is automatically\ngenerated and will be overwritten the next time the doc generator is run.\n\nTo make changes to this section, please update the @packageDocumentation section\nof src/index.js or src/index.ts\n\nTo experiment with formatting, please run \"npm run docs\" from the root of this\nrepo and examine the changes made.\n\n-->\n\nVarious Blockstore implementations are available.\n\n## BaseBlockstore\n\nProvides a complete implementation of the Blockstore interface.  You must implement `.get`, `.put`, etc.\n\n## Example\n\n```js\nimport { BaseBlockstore } from 'blockstore-core'\n\nclass MyCustomBlockstore extends BaseBlockstore {\n  put (key, val, options) {\n    // store a block\n  }\n\n  get (key, options) {\n    // retrieve a block\n  }\n\n  // ...etc\n}\n```\n\n## MemoryBlockstore\n\nA simple Blockstore that stores blocks in memory.\n\n## Example\n\n```js\nimport { MemoryBlockstore } from 'blockstore-core'\n\nconst store = new MemoryBlockstore()\n```\n\n## BlackHoleBlockstore\n\nA Blockstore that does not store any blocks.\n\n## Example\n\n```js\nimport { BlackHoleBlockstore } from 'blockstore-core'\n\nconst store = new BlackHoleBlockstore()\n```\n\n## TieredBlockstore\n\nA tiered blockstore wraps one or more blockstores and will query each in parallel to retrieve a block - the operation will succeed if any wrapped store has the block.\n\nWrites are invoked on all wrapped blockstores.\n\n## Example\n\n```js\nimport { TieredBlockstore } from 'blockstore-core'\n\nconst store = new TieredBlockstore([\n  store1,\n  store2,\n  // ...etc\n])\n```\n\n## IdentityBlockstore\n\nAn identity blockstore is one that deals exclusively in Identity CIDs - this is a special CID with the codec [0x00](https://github.com/multiformats/multicodec/blob/d06fc6194710e8909bac64273c43f16b56ca4c34/table.csv#L2) where the multihash digest is the data that makes up the block.\n\n## Example\n\n```TypeScript\nimport { IdentityBlockstore } from 'blockstore-core'\nimport { CID } from 'multiformats/cid'\n\nconst blockstore = new IdentityBlockstore()\n\nblockstore.has(CID.parse('QmFoo')) // false\n\nblockstore.has(CID.parse('bafkqac3imvwgy3zao5xxe3de')) // true\n```\n\n# Install\n\n```console\n$ npm i blockstore-core\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make its exports available as `BlockstoreCore` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/blockstore-core/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://ipfs.github.io/js-stores/modules/blockstore-core.html>\n\n# License\n\nLicensed under either of\n\n- Apache 2.0, ([LICENSE-APACHE](https://github.com/ipfs/js-stores/blob/main/packages/blockstore-core/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/ipfs/js-stores/blob/main/packages/blockstore-core/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)\n\n# Contribute\n\nContributions welcome! Please check out [the issues](https://github.com/ipfs/js-stores/issues).\n\nAlso see our [contributing document](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md) for more information on how we work, and about contributing in general.\n\nPlease be aware that all interactions related to this repo are subject to the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\n[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)\n","publish_time":1726237701235,"_cnpm_publish_time":1726237701235,"dist-tags":{"latest":"7.0.1"}}