{"name":"blockstore-core","version":"3.0.0","description":"Contains various implementations of the API contract described in interface-blockstore","author":{"name":"Alex Potsides","email":"alex.potsides@protocol.ai"},"license":"Apache-2.0 OR MIT","homepage":"https://github.com/ipfs/js-blockstore-core#readme","repository":{"type":"git","url":"git+https://github.com/ipfs/js-blockstore-core.git"},"bugs":{"url":"https://github.com/ipfs/js-blockstore-core/issues"},"keywords":["datastore","interface","ipfs","key-value"],"engines":{"node":">=16.0.0","npm":">=7.0.0"},"type":"module","types":"./dist/src/index.d.ts","typesVersions":{"*":{"*":["*","dist/*","dist/src/*","dist/src/*/index"],"src/*":["*","dist/*","dist/src/*","dist/src/*/index"]}},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./src/index.js"},"./base":{"types":"./src/base.d.ts","import":"./src/base.js"},"./errors":{"types":"./src/errors.d.ts","import":"./src/errors.js"},"./memory":{"types":"./src/memory.d.ts","import":"./src/memory.js"}},"eslintConfig":{"extends":"ipfs","parserOptions":{"sourceType":"module"}},"release":{"branches":["master"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"breaking":true,"release":"major"},{"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"]},"scripts":{"clean":"aegir clean","lint":"aegir lint","build":"aegir build","release":"aegir release","test":"aegir test -t node -t browser -t webworker -t electron-main","test:node":"aegir test -t node --cov","test:chrome":"aegir test -t browser --cov","test:chrome-webworker":"aegir test -t webworker","test:firefox":"aegir test -t browser -- --browser firefox","test:firefox-webworker":"aegir test -t webworker -- --browser firefox","test:electron-main":"aegir test -t electron-main","dep-check":"aegir dep-check","docs":"aegir docs"},"dependencies":{"err-code":"^3.0.1","interface-blockstore":"^4.0.0","interface-store":"^3.0.0","it-all":"^2.0.0","it-drain":"^2.0.0","it-filter":"^2.0.0","it-take":"^2.0.0","multiformats":"^11.0.0"},"devDependencies":{"aegir":"^37.9.0","interface-blockstore-tests":"^4.0.0"},"gitHead":"1534f942d765961c1ac0e6973774678a6f826944","_id":"blockstore-core@3.0.0","_nodeVersion":"18.12.1","_npmVersion":"8.19.3","dist":{"integrity":"sha512-5ZZB5nh6kErcjZ/CTK6lCwTIGlPdkTXbD8+2xLC4Fm0WGh7g2e2lW2bfURw7mvnPtSX1xV+sN4V2ndowSgIiHQ==","shasum":"08f52d954fe079d2735b745d218e737071badd97","tarball":"http://registry-npm.ywwl.com/blockstore-core/download/blockstore-core-3.0.0.tgz","fileCount":17,"unpackedSize":38463,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4bcSybJOi9gj6vvwocuJpv34DuMrJUVPDNo6VnqAuOwIhALUtHLQdUgyhT+PxAyqpx7ufQN4S3PASF48tpiFTc9Bn"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjuCIoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmobkw/8CUpfr3HUpBKTcCEPSfV26lTEsgrlgmBDqVCfTPUFXwn/7bH6\r\nQH+w8wel4Ssdbb3KXP3fO1XNzAmob2jUjWMbsvIbV2hh3Cw99znf1NLNdVY2\r\nqYITJQrkysUfjkJFjr0O8iRyUDNVqF8QRkGYaBP/QbppHGOiIJYltatUsHqu\r\nXCk0vQIaFam4kI8/cPsP+h6PRyAHaG0fvXbtC3czp9MtIqaUKX0u7UYSrlmn\r\nd+3IdWkMrkH7WIWZnkV+q+c64anx1e/bG6OqnJqEXWnfElA9GmseRnxkhBM8\r\nmWmAKhrXniTzdrWAXq2earjcEXZ4mPhPzU9U2bjdPCsmNeD95aFg3QA29KQk\r\nlqyTGQZ4WtfOXWhwpNzPc7sfRLaF6bUmHtwNKnmbK+lrnYAaYu//M22ubq//\r\nqLtc7y08IvE8W4skBb/rNIlvYZymZ99mcD9Yw7FEaRe7du0j6wN9cDTPxb2r\r\niXUak6j7zsFYVFzQ33kS/KTOUNlnjCderEK1cg1PDEjtc/2EEq5OIPRgYabB\r\nAbqO0ueF+MBJpmtnKSnqLvsVwVF41IR30w2KFefMJVVPgOgBCGECDz8rRSEt\r\nbizSMgAtQ7ySiYYSxpFOcB9m1CwuhgkorfKKGoG4/zuudHZvLjRYoSEQWqk9\r\nFEfs+NQwLdg5wik+XcJpzzj2emvAARqvAB8=\r\n=8Yy5\r\n-----END PGP SIGNATURE-----\r\n","size":11218,"noattachment":false,"key":"/blockstore-core/-/blockstore-core-3.0.0.tgz"},"_npmUser":{"name":"npm-service-account-ipfs","email":"npm-service-account+ipfs@protocol.ai"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"npm-service-account-ipfs","email":"npm-service-account+ipfs@protocol.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/blockstore-core_3.0.0_1673011752009_0.8321517021361242"},"_hasShrinkwrap":false,"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## Implementations\n\n- Base: [`src/base`](src/base.ts)\n- Memory: [`src/memory`](src/memory.ts)\n- BlackHole: ['src/black-hole](src/black-hole.ts)\n- Tiered: ['src/tiered](src/tiered.ts)\n\n## Example - BaseBlockstore\n\nProvides a complete implementation of the Blockstore interface.  You must implement `.get`, `.put`, etc.\n\n```js\nimport { BaseBlockstore } from 'blockstore-core/base'\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## Example - MemoryBlockstore\n\nA simple Blockstore that stores blocks in memory.\n\n```js\nimport { MemoryBlockstore } from 'blockstore-core/memory'\n\nconst store = new MemoryBlockstore()\n```\n\n## Example - BlackHoleBlockstore\n\nA Blockstore that does not store any blocks.\n\n```js\nimport { BlackHoleBlockstore } from 'blockstore-core/black-hole'\n\nconst store = new BlackHoleBlockstore()\n```\n\n## Example - 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```js\nimport { TieredBlockstore } from 'blockstore-core/tiered'\n\nconst store = new TieredBlockstore([\n  store1,\n  store2,\n  // ...etc\n])\n```\n\n## Example - 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```TypeScript\nimport { IdentityBlockstore } from 'blockstore-core/identity'\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 it's 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](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](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":1673011752208,"_cnpm_publish_time":1673011752208,"dist-tags":{"latest":"7.0.1"}}