{"_id":"ipfs-blocks","_rev":"4631878","name":"ipfs-blocks","description":"JavaScript Implementation of Block and BlockService","dist-tags":{"latest":"0.2.3"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"time":{"modified":"2026-04-10T18:56:24.000Z","created":"2016-01-29T07:27:58.544Z","0.2.3":"2016-04-24T21:12:02.020Z","0.2.2":"2016-04-24T20:47:42.190Z","0.2.1":"2016-04-24T17:32:58.597Z","0.2.0":"2016-04-19T20:37:11.167Z","0.1.2":"2016-04-11T12:46:57.043Z","0.1.1":"2016-04-08T20:42:02.764Z","0.1.0":"2016-01-29T07:27:58.544Z"},"users":{},"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-blocks.git"},"versions":{"0.2.3":{"name":"ipfs-blocks","version":"0.2.3","description":"JavaScript Implementation of Block and BlockService","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"aegir-test","test:node":"aegir-test node","test:browser":"aegir-test browser","release":"aegir-release","release-minor":"aegir-release minor","release-major":"aegir-release major","coverage":"aegir-coverage","coverage-publish":"aegir-coverage publish"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-blocks.git"},"keywords":["IPFS"],"authors":["David Dias <daviddias@ipfs.io>","Vijayee Kulkaa <vijayee.kulkaa@hushmail.com"],"license":"MIT","bugs":{"url":"https://github.com/ipfs/js-ipfs-blocks/issues"},"homepage":"https://github.com/ipfs/js-ipfs-blocks#readme","devDependencies":{"aegir":"^2.1.1","bs58":"^3.0.0","buffer-loader":"0.0.1","chai":"^3.5.0","fs-blob-store":"^5.2.1","idb-plus-blob-store":"^1.1.1","ipfs-repo":"^0.6.6","lodash":"^4.8.2","ncp":"^2.0.0","pre-commit":"^1.1.2","rimraf":"^2.5.1"},"dependencies":{"async":"^1.5.2","bl":"^1.0.1","detect-node":"^2.0.3","multihashing":"^0.2.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Stephen Whitmore","email":"stephen.whitmore@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"}],"gitHead":"f80f8afbca915eafafb3c5d768c91a9e3904aca8","_id":"ipfs-blocks@0.2.3","_shasum":"78fbddeb5f275740a145ef453a156a829c27ac14","_from":".","_npmVersion":"3.8.0","_nodeVersion":"4.3.2","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"78fbddeb5f275740a145ef453a156a829c27ac14","size":440952,"noattachment":false,"key":"/ipfs-blocks/-/ipfs-blocks-0.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/ipfs-blocks/download/ipfs-blocks-0.2.3.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ipfs-blocks-0.2.3.tgz_1461532319846_0.9488067114725709"},"directories":{},"publish_time":1461532322020,"deprecated":"use ipfs-block and ipfs-block-service instead","_hasShrinkwrap":false,"_cnpm_publish_time":1461532322020,"_cnpmcore_publish_time":"2021-12-16T19:10:39.945Z"},"0.2.2":{"name":"ipfs-blocks","version":"0.2.2","description":"JavaScript Implementation of Block and BlockService","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"aegir-test","test:node":"aegir-test node","test:browser":"aegir-test browser","release":"aegir-release","release-minor":"aegir-release minor","release-major":"aegir-release major","coverage":"aegir-coverage","coverage-publish":"aegir-coverage publish"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-blocks.git"},"keywords":["IPFS"],"authors":["David Dias <daviddias@ipfs.io>","Vijayee Kulkaa <vijayee.kulkaa@hushmail.com"],"license":"MIT","bugs":{"url":"https://github.com/ipfs/js-ipfs-blocks/issues"},"homepage":"https://github.com/ipfs/js-ipfs-blocks#readme","devDependencies":{"aegir":"^2.1.1","bs58":"^3.0.0","buffer-loader":"0.0.1","chai":"^3.5.0","fs-blob-store":"^5.2.1","idb-plus-blob-store":"^1.1.1","ipfs-repo":"^0.6.6","lodash":"^4.8.2","ncp":"^2.0.0","pre-commit":"^1.1.2","rimraf":"^2.5.1"},"dependencies":{"async":"^1.5.2","bl":"^1.0.1","detect-node":"^2.0.3","multihashing":"^0.2.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Stephen Whitmore","email":"stephen.whitmore@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"}],"gitHead":"a79f65075d4b0eeeb00b9fcd64e7bedbc3aee9be","_id":"ipfs-blocks@0.2.2","_shasum":"08478f00ba298a0003e6a5a219cd6372b9d5d28d","_from":".","_npmVersion":"3.8.0","_nodeVersion":"4.3.2","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"08478f00ba298a0003e6a5a219cd6372b9d5d28d","size":440917,"noattachment":false,"key":"/ipfs-blocks/-/ipfs-blocks-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/ipfs-blocks/download/ipfs-blocks-0.2.2.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ipfs-blocks-0.2.2.tgz_1461530859290_0.10608515446074307"},"directories":{},"publish_time":1461530862190,"deprecated":"use ipfs-block and ipfs-block-service instead","_hasShrinkwrap":false,"_cnpm_publish_time":1461530862190,"_cnpmcore_publish_time":"2021-12-16T19:10:41.427Z"},"0.2.1":{"name":"ipfs-blocks","version":"0.2.1","description":"JavaScript Implementation of Block and BlockService","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"aegir-test","test:node":"aegir-test node","test:browser":"aegir-test browser","release":"aegir-release","release-minor":"aegir-release minor","release-major":"aegir-release major","coverage":"aegir-coverage","coverage-publish":"aegir-coverage publish"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-blocks.git"},"keywords":["IPFS"],"authors":["David Dias <daviddias@ipfs.io>","Vijayee Kulkaa <vijayee.kulkaa@hushmail.com"],"license":"MIT","bugs":{"url":"https://github.com/ipfs/js-ipfs-blocks/issues"},"homepage":"https://github.com/ipfs/js-ipfs-blocks#readme","devDependencies":{"aegir":"^2.1.1","bs58":"^3.0.0","buffer-loader":"0.0.1","chai":"^3.5.0","fs-blob-store":"^5.2.1","idb-plus-blob-store":"^1.1.1","ipfs-repo":"^0.6.6","lodash":"^4.8.2","ncp":"^2.0.0","pre-commit":"^1.1.2","rimraf":"^2.5.1"},"dependencies":{"async":"^1.5.2","bl":"^1.0.1","detect-node":"^2.0.3","multihashing":"^0.2.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Stephen Whitmore","email":"stephen.whitmore@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"}],"gitHead":"ba62423ee49440e7f342f936e887cd100ad4a53c","_id":"ipfs-blocks@0.2.1","_shasum":"e511df438ee1893cd64ccb90d102bfd44f78dcfc","_from":".","_npmVersion":"3.8.3","_nodeVersion":"4.4.0","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"e511df438ee1893cd64ccb90d102bfd44f78dcfc","size":442323,"noattachment":false,"key":"/ipfs-blocks/-/ipfs-blocks-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ipfs-blocks/download/ipfs-blocks-0.2.1.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ipfs-blocks-0.2.1.tgz_1461519175969_0.05777245224453509"},"directories":{},"publish_time":1461519178597,"deprecated":"use ipfs-block and ipfs-block-service instead","_hasShrinkwrap":false,"_cnpm_publish_time":1461519178597,"_cnpmcore_publish_time":"2021-12-16T19:10:42.732Z"},"0.2.0":{"name":"ipfs-blocks","version":"0.2.0","description":"JavaScript Implementation of Block and BlockService","main":"lib/index.js","jsnext:main":"src/index.js","scripts":{"lint":"aegir-lint","build":"aegir-build","test":"aegir-test","test:node":"aegir-test node","test:browser":"aegir-test browser","release":"aegir-release","release-minor":"aegir-release minor","release-major":"aegir-release major","coverage":"aegir-coverage","coverage-publish":"aegir-coverage publish"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-blocks.git"},"keywords":["IPFS"],"authors":["David Dias <daviddias@ipfs.io>","Vijayee Kulkaa <vijayee.kulkaa@hushmail.com"],"license":"MIT","bugs":{"url":"https://github.com/ipfs/js-ipfs-blocks/issues"},"homepage":"https://github.com/ipfs/js-ipfs-blocks#readme","devDependencies":{"aegir":"^2.1.1","bs58":"^3.0.0","buffer-loader":"0.0.1","chai":"^3.5.0","fs-blob-store":"^5.2.1","idb-plus-blob-store":"^1.0.0","ipfs-repo":"^0.6.1","lodash":"^4.8.2","ncp":"^2.0.0","pre-commit":"^1.1.2","rimraf":"^2.5.1"},"dependencies":{"async":"^1.5.2","bl":"^1.0.1","detect-node":"^2.0.3","multihashing":"^0.2.0"},"contributors":[{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Stephen Whitmore","email":"stephen.whitmore@gmail.com"},{"name":"dignifiedquire","email":"dignifiedquire@gmail.com"}],"gitHead":"d3e6baf21bb2f35924551c22737e759746b231e7","_id":"ipfs-blocks@0.2.0","_shasum":"5d3d9af40a99fa3c7d5c74ef39cf8f99f81cbdeb","_from":".","_npmVersion":"3.8.3","_nodeVersion":"4.4.0","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"5d3d9af40a99fa3c7d5c74ef39cf8f99f81cbdeb","size":372562,"noattachment":false,"key":"/ipfs-blocks/-/ipfs-blocks-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ipfs-blocks/download/ipfs-blocks-0.2.0.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ipfs-blocks-0.2.0.tgz_1461098229721_0.15144529333338141"},"directories":{},"publish_time":1461098231167,"deprecated":"use ipfs-block and ipfs-block-service instead","_hasShrinkwrap":false,"_cnpm_publish_time":1461098231167,"_cnpmcore_publish_time":"2021-12-16T19:10:44.775Z"},"0.1.2":{"name":"ipfs-blocks","version":"0.1.2","description":"JavaScript Implementation of Block and BlockService","main":"src/index.js","scripts":{"lint":"dignified-lint","build":"dignified-build","test":"dignified-test","test:node":"dignified-test node","test:browser":"dignified-test browser","release":"dignified-release","coverage":"dignified-coverage"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-blocks.git"},"keywords":["IPFS"],"authors":["David Dias <daviddias@ipfs.io>","Vijayee Kulkaa <vijayee.kulkaa@hushmail.com"],"license":"MIT","bugs":{"url":"https://github.com/ipfs/js-ipfs-blocks/issues"},"homepage":"https://github.com/ipfs/js-ipfs-blocks#readme","devDependencies":{"bs58":"^3.0.0","buffer-loader":"0.0.1","chai":"^3.5.0","dignified.js":"^1.0.0","fs-blob-store":"^5.2.1","idb-plus-blob-store":"^1.0.0","ipfs-repo":"^0.6.1","lodash":"^4.8.2","ncp":"^2.0.0","pre-commit":"^1.1.2","rimraf":"^2.5.1"},"dependencies":{"async":"^1.5.2","bl":"^1.0.1","detect-node":"^2.0.3","multihashing":"^0.2.0"},"gitHead":"9806af80b9e70a35a749660327916b4146b37827","_id":"ipfs-blocks@0.1.2","_shasum":"4300cf02cd61aec79a04aa144b57c8940146b4b8","_from":".","_npmVersion":"3.8.3","_nodeVersion":"4.4.0","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"4300cf02cd61aec79a04aa144b57c8940146b4b8","size":371406,"noattachment":false,"key":"/ipfs-blocks/-/ipfs-blocks-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/ipfs-blocks/download/ipfs-blocks-0.1.2.tgz"},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ipfs-blocks-0.1.2.tgz_1460378815900_0.03420962789095938"},"directories":{},"publish_time":1460378817043,"deprecated":"use ipfs-block and ipfs-block-service instead","_hasShrinkwrap":false,"_cnpm_publish_time":1460378817043,"_cnpmcore_publish_time":"2021-12-16T19:10:46.233Z"},"0.1.1":{"name":"ipfs-blocks","version":"0.1.1","description":"JavaScript Implementation of Block and BlockService","main":"src/index.js","scripts":{"lint":"dignified-lint","build":"dignified-build","test":"dignified-test","test:node":"dignified-test node","test:browser":"dignified-test browser","release":"dignified-release","coverage":"dignified-coverage"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-blocks.git"},"keywords":["IPFS"],"authors":["David Dias <daviddias@ipfs.io>","Vijayee Kulkaa <vijayee.kulkaa@hushmail.com"],"license":"MIT","bugs":{"url":"https://github.com/ipfs/js-ipfs-blocks/issues"},"homepage":"https://github.com/ipfs/js-ipfs-blocks#readme","devDependencies":{"bs58":"^3.0.0","chai":"^3.5.0","dignified.js":"^1.0.0","fs-blob-store":"^5.2.1","ipfs-repo":"^0.3.0","ncp":"^2.0.0","pre-commit":"^1.1.2","rimraf":"^2.5.1"},"dependencies":{"async":"^1.5.2","bl":"^1.0.1","detect-node":"^2.0.3","multihashing":"^0.2.0"},"gitHead":"c4832060317bbde148a78882d3e670a7f2be1f69","_id":"ipfs-blocks@0.1.1","_shasum":"9c3556db33acc4b2cee2dfab234eb1b2840480d5","_from":".","_npmVersion":"3.8.3","_nodeVersion":"4.4.0","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"9c3556db33acc4b2cee2dfab234eb1b2840480d5","size":384901,"noattachment":false,"key":"/ipfs-blocks/-/ipfs-blocks-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ipfs-blocks/download/ipfs-blocks-0.1.1.tgz"},"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/ipfs-blocks-0.1.1.tgz_1460148120268_0.9132884372957051"},"directories":{},"publish_time":1460148122764,"deprecated":"use ipfs-block and ipfs-block-service instead","_hasShrinkwrap":false,"_cnpm_publish_time":1460148122764,"_cnpmcore_publish_time":"2021-12-16T19:10:47.388Z"},"0.1.0":{"name":"ipfs-blocks","version":"0.1.0","description":"JavaScript Implementation of Block and BlockService","main":"src/index.js","scripts":{"test":"node tests/index.js","lint":"standard"},"pre-commit":["lint","test"],"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-blocks.git"},"keywords":["IPFS"],"authors":["David Dias <daviddias@ipfs.io>","Vijayee Kulkaa <vijayee.kulkaa@hushmail.com"],"license":"MIT","bugs":{"url":"https://github.com/ipfs/js-ipfs-blocks/issues"},"homepage":"https://github.com/ipfs/js-ipfs-blocks#readme","devDependencies":{"async":"^1.5.2","bs58":"^3.0.0","fs-blob-store":"^5.2.1","ipfs-repo":"^0.3.0","ncp":"^2.0.0","pre-commit":"^1.1.2","rimraf":"^2.5.1","standard":"^5.4.1","tape":"^4.4.0"},"dependencies":{"bl":"^1.0.1","multihashing":"^0.2.0"},"gitHead":"3fae45953951bed53be97b55cb0b42bdf2aac022","_id":"ipfs-blocks@0.1.0","_shasum":"aecb055f56990b992a482d97a57a9aeb3fe03da4","_from":".","_npmVersion":"3.5.3","_nodeVersion":"5.5.0","_npmUser":{"name":"daviddias","email":"daviddias.p@gmail.com"},"maintainers":[{"name":"daviddias","email":"daviddias.p@gmail.com"}],"dist":{"shasum":"aecb055f56990b992a482d97a57a9aeb3fe03da4","size":18014,"noattachment":false,"key":"/ipfs-blocks/-/ipfs-blocks-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ipfs-blocks/download/ipfs-blocks-0.1.0.tgz"},"directories":{},"publish_time":1454052478544,"deprecated":"use ipfs-block and ipfs-block-service instead","_hasShrinkwrap":false,"_cnpm_publish_time":1454052478544,"_cnpmcore_publish_time":"2021-12-16T19:10:47.610Z"}},"readme":"IPFS Blocks JavaScript Implementation\n=====================================\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)\n[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)\n[![Travis CI](https://travis-ci.org/ipfs/js-ipfs-blocks.svg?branch=master)](https://travis-ci.org/ipfs/js-ipfs-blocks)\n[![Circle CI](https://circleci.com/gh/ipfs/js-ipfs-blocks.svg?style=svg)](https://circleci.com/gh/ipfs/js-ipfs-blocks)\n[![Coverage Status](https://coveralls.io/repos/github/ipfs/js-ipfs-blocks/badge.svg?branch=master)](https://coveralls.io/github/ipfs/js-ipfs-blocks?branch=master)\n[![Dependency Status](https://david-dm.org/ipfs/js-ipfs-blocks.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs-blocks)\n[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat-square)](https://github.com/feross/standard)\n\n> [IPFS][ipfs] implementation of the BlockService and Block data structure in\n> JavaScript.\n\n## Description\n\n**Block** - A block is a blob of binary data.\n\n**BlockService** - A BlockService is a content-addressable store for blocks,\nproviding an API for adding, deleting, and retrieving blocks. A BlockService is\nbacked by an [IPFS Repo][repo] as its datastore for blocks, and uses an [IPFS\nExchange][bitswap] implementation to fetch blocks from the network.\n\n```markdown\n┌────────────────────┐\n│     BlockService   │\n└────────────────────┘\n           │\n     ┌─────┴─────┐\n     ▼           ▼\n┌─────────┐ ┌────────┐\n│IPFS Repo│ │Exchange│\n└─────────┘ └────────┘\n```\n\n## Example\n\n```js\nconst blocks = require('ipfs-blocks')\nconst IPFSRepo = require('ipfs-repo')  // storage repo\nconst memstore = require('abstract-blob-store')  // in-memory store\n\n// setup a repo\nvar repo = new IPFSRepo('example', { stores: memstore })\n\n// create a block\nconst block = new blocks.Block('hello warld')\nconsole.log(block.data)\nconsole.log(block.key)\n\n// create a service\nconst bs = new blocks.BlockService(repo)\n\n// add the block, then retrieve it\nbs.addBlock(block, function (err) {\n  bs.getBlock(block.key, function (err, b) {\n    console.log(block.data.toString() === b.data.toString())\n  })\n})\n```\n\noutputs\n\n```\n<Buffer 68 65 6c 6c 6f 20 77 61 72 6c 64>\n\n<Buffer 12 20 db 3c 15 23 3f f3 84 8f 42 fe 3b 74 78 90 90 5a 80 7e a6 ef 2b 6d 2f 3c 8b 2c b7 ae be 86 3c 4d>\n\ntrue\n\n```\n\n## Installation\n\n### npm\n\n```sh\n> npm i ipfs-blocks\n```\n\n## Setup\n\n### Node.js\n\n```js\nconst blocks = require('ipfs-blocks')\n```\n\n### Browser: Browserify, Webpack, other bundlers\n\nThe code published to npm that gets loaded on require is in fact a ES5\ntranspiled version with the right shims added. This means that you can require\nit and use with your favourite bundler without having to adjust asset management\nprocess.\n\n```JavaScript\nvar blocks = require('ipfs-blocks')\n```\n\n### Browser: `<script>` Tag\n\nLoading this module through a script tag will make the `Unixfs` obj available in\nthe global namespace.\n\n```html\n<script src=\"https://npmcdn.com/ipfs-blocks/dist/index.min.js\"></script>\n<!-- OR -->\n<script src=\"https://npmcdn.com/ipfs-blocks/dist/index.js\"></script>\n```\n\n## API\n\n```js\nconst blocks = require('ipfs-blocks')\n```\n\n### Block\n\n#### var block = new blocks.Block(data)\n\nCreates a new block with raw data `data`.\n\n#### block.data\n\nThe raw data of the block. Its format matches whatever was provided in its\nconstructor.\n\n#### block.key\n\nThe [multihash][multihash] of the block's data, as a buffer.\n\n### var bs = new blocks.BlockService(repo[, exchange])\n\nCreates a new block service backed by [IPFS Repo][repo] `repo` for storage, and\n[IPFS Exchange][bitswap] for retrieving blocks from the network. Providing an\n`exchange` is optional.\n\n#### bs.addBlock(block, callback(err))\n\nAsynchronously adds a block instance to the underlying repo.\n\n#### bs.addBlocks(blocks, callback(err))\n\nAsynchronously adds an array of block instances to the underlying repo.\n\n*Does not guarantee atomicity.*\n\n#### bs.getBlock(multihash, callback(err, block))\n\nAsynchronously returns the block whose content multihash matches `multihash`.\nReturns an error (`err.code === 'ENOENT'`) if the block does not exist.\n\nIf the block could not be found, expect `err.code` to be `'ENOENT'`.\n\n#### bs.getBlocks(multihashes, callback(err, blocks))\n\nAsynchronously returns the blocks whose content multihashes match the array\n`multihashes`.\n\n`blocks` is an object that maps each `multihash` to an object of the form\n\n```js\n{\n  err: Error\n  block: Block\n}\n```\n\nExpect `blocks[multihash].err.code === 'ENOENT'`  and `blocks[multihash].block\n=== null` if a block did not exist.\n\n*Does not guarantee atomicity.*\n\n#### bs.deleteBlock(multihash, callback(err))\n\nAsynchronously deletes the block from the store with content multihash matching\n`multihash`, if it exists.\n\n#### bs.deleteBlocks(multihashes, callback(err))\n\nAsynchronously deletes all blocks from the store with content multihashes matching\nfrom the array `multihashes`.\n\n*Does not guarantee atomicity.*\n\n## License\n\nMIT\n\n[ipfs]: https://ipfs.io\n[repo]: https://github.com/ipfs/specs/tree/master/repo\n[bitswap]: https://github.com/ipfs/specs/tree/master/bitswap\n[multihash]: https://github.com/jbenet/js-multihash\n","_attachments":{},"homepage":"https://github.com/ipfs/js-ipfs-blocks#readme","bugs":{"url":"https://github.com/ipfs/js-ipfs-blocks/issues"},"license":"MIT"}