{"name":"blockstore-core","version":"1.0.2","description":"Contains various implementations of the API contract described in interface-blockstore","leadMaintainer":"Alex Potsides <alex.potsides@protocol.ai>","main":"./cjs/src/index.js","types":"types/src/index.d.ts","typesVersions":{"*":{"*":["types/*","types/src/*"],"types/*":["types/*","types/*"]}},"exports":{".":{"browser":"./esm/src/index.js","require":"./cjs/src/index.js","import":"./esm/src/index.js"},"./base":{"browser":"./esm/src/base.js","require":"./cjs/src/base.js","import":"./esm/src/base.js"},"./errors":{"browser":"./esm/src/errors.js","require":"./cjs/src/errors.js","import":"./esm/src/errors.js"},"./memory":{"browser":"./esm/src/memory.js","require":"./cjs/src/memory.js","import":"./esm/src/memory.js"}},"eslintConfig":{"extends":"ipfs","parserOptions":{"sourceType":"module"}},"scripts":{"clean":"rimraf dist types","prepare":"aegir build --no-bundle && cp -R types dist","lint":"aegir ts -p check && aegir lint","build":"aegir build","release":"aegir release --target node","release-minor":"aegir release --type minor --target node","release-major":"aegir release --type major --target node","pretest":"aegir build --esm-tests","test":"aegir test","dep-check":"aegir dep-check -i rimraf -i interface-blockstore -i interface-store -i aegir -i util"},"repository":{"type":"git","url":"git+https://github.com/ipfs/js-blockstore-core.git"},"keywords":["interface","key-value","ipfs","datastore"],"author":{"name":"Alex Potsides","email":"alex.potsides@protocol.ai"},"license":"(Apache-2.0 OR MIT)","bugs":{"url":"https://github.com/ipfs/js-blockstore-core/issues"},"homepage":"https://github.com/ipfs/js-blockstore-core#readme","devDependencies":{"@types/debug":"^4.1.5","aegir":"^35.0.2","interface-blockstore-tests":"^2.0.1","it-all":"^1.0.4","util":"^0.12.4"},"dependencies":{"err-code":"^3.0.1","interface-blockstore":"^2.0.2","interface-store":"^2.0.1","it-drain":"^1.0.4","it-filter":"^1.0.2","it-take":"^1.0.1","multiformats":"^9.4.7"},"contributors":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"browser":{".":"./cjs/src/index.js","./base":"./cjs/src/base.js","./errors":"./cjs/src/errors.js","./memory":"./cjs/src/memory.js"},"_id":"blockstore-core@1.0.2","_nodeVersion":"16.8.0","_npmVersion":"7.21.0","dist":{"integrity":"sha512-CYOaAvgVoJDqxbGG4YVyLMZ5mmS+Icwn7oHnayPko/FGpiinixI/CGMrErbDSaVSkjhuea9tpU23tt+Jx13n+g==","shasum":"8dfb8fa2586962a5ab831426564eeb947b06faf2","tarball":"http://registry-npm.ywwl.com/blockstore-core/download/blockstore-core-1.0.2.tgz","fileCount":34,"unpackedSize":47900,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhOeIuCRA9TVsSAnZWagAAYz4QAJ2CQcBuYXBCnYA9ZF0z\nOH05F1dt97BHlfUwODQwf+Y95/co6+jcv04T5nPyEVfHBGxKuXc4lJZHEgD2\nFMo+/jfJOVa5j5w+ArxNgCp4bk9mhzVWcPsv2rN1L0PlmrQxhmAXeCspQ4qY\nKLTNiFwfnb3UTbzFPYEtbBSq90hfUXZACBJj81U0eiGeX/5Shpkmm0wEVMrT\nLzwAr9Mn0M3UCtoidIywpadXIELoX4hdukgbpZPII5ZjxYxCJHIqJNDZ4TSN\n/BdSUjyIwU68UAQ/NXEg0VQyGlAUlpU4xUrZRnuPHXMj/4Ru5tfXaZZpOrQ4\nN6QDHyS8B3niNX/pol3rcfxzEzZk9bUcN36KMzeOTJIFdi5+1mvru7nrGmJw\nxudgJ4qryXBMPeI6bib5TAsLd3JPsqEgs+VunMrMYd3nKlsxekstjEJfVdLt\nPwY2iej8OGtcHAEkPrZ+hhBhXBuXH2dlWM986/0D3mea9v7SwTKfjRp291ub\n3YOQ/9bNtpdJpkDMTsX8d1GWW2RbouCMHaaPn4Ln2MrMHNgBjp0Lrc+MXS7I\nxm8jb7GdIghiuFABflaMiS0U+KMffBBiDZ8B6FRNpERkMSGe9DWyu5lROs+w\n9+7JxOZRKuOtwCkrX12OKuzegZOt86aVAaDwKuVmFDwecq7zUumJv9Q1Th8i\nw0Rn\r\n=fPTq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGsjk5T4IlqmwWXAjo6y8LriMFSH9ASVgIMy8dX4NhZYAiEAq/t/Smu4dIBwJ3z4TJmM054RnAW6yKX3ntQXLojCbS8="}],"size":12224,"noattachment":false,"key":"/blockstore-core/-/blockstore-core-1.0.2.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/blockstore-core_1.0.2_1631183406542_0.5379188464090916"},"_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":1631183406777,"_cnpm_publish_time":1631183406777,"dist-tags":{"latest":"7.0.1"}}