{"name":"ipfs-unixfs-exporter","version":"0.35.8","description":"JavaScript implementation of the UnixFs exporter used by IPFS","leadMaintainer":"Alex Potsides <alex.potsides@protocol.ai>","main":"src/index.js","browser":{"fs":false},"scripts":{"test":"aegir test","test:node":"aegir test -t node","test:browser":"aegir test -t browser","test:webworker":"aegir test -t webworker","build":"aegir build","lint":"aegir lint","release":"aegir release","release-minor":"aegir release --type minor","release-major":"aegir release --type major","coverage":"aegir coverage"},"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-unixfs-exporter.git"},"keywords":["IPFS"],"license":"MIT","bugs":{"url":"https://github.com/ipfs/js-ipfs-unixfs-exporter/issues"},"engines":{"node":">=8.0.0","npm":">=3.0.0"},"homepage":"https://github.com/ipfs/js-ipfs-unixfs-exporter#readme","devDependencies":{"aegir":"^18.0.2","chai":"^4.2.0","detect-node":"^2.0.4","dirty-chai":"^2.0.1","ipld":"~0.20.2","ipld-dag-pb":"~0.15.2","ipld-in-memory":"^2.0.0","pull-pushable":"^2.2.0","pull-stream-to-stream":"^1.3.4","pull-zip":"^2.0.1","sinon":"^7.1.0","stream-to-pull-stream":"^1.7.2"},"dependencies":{"async":"^2.6.1","cids":"~0.5.5","ipfs-unixfs":"~0.1.16","ipfs-unixfs-importer":"~0.38.0","pull-cat":"^1.1.11","pull-paramap":"^1.2.2","pull-stream":"^3.6.9","pull-traverse":"^1.0.3"},"contributors":[{"name":"Alan Shaw","email":"alan.shaw@protocol.ai"},{"name":"Alan Shaw","email":"alan@tableflip.io"},{"name":"Arpit Agarwal","email":"atvanguard@users.noreply.github.com"},{"name":"Bernard Mordan","email":"bernard@tableflip.io"},{"name":"Dan Ordille","email":"dordille@gmail.com"},{"name":"David Dias","email":"daviddias.p@gmail.com"},{"name":"Diogo Silva","email":"fsdiogo@gmail.com"},{"name":"Francisco Baio Dias","email":"xicombd@gmail.com"},{"name":"Friedel Ziegelmayer","email":"dignifiedquire@gmail.com"},{"name":"Greenkeeper","email":"support@greenkeeper.io"},{"name":"Marcin Rataj","email":"lidel@lidel.org"},{"name":"Pedro Teixeira","email":"i@pgte.me"},{"name":"Richard Littauer","email":"richard.littauer@gmail.com"},{"name":"Richard Schneider","email":"makaretu@gmail.com"},{"name":"Stephen Whitmore","email":"stephen.whitmore@gmail.com"},{"name":"Volker Mische","email":"volker.mische@gmail.com"},{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"greenkeeper[bot]","email":"greenkeeper[bot]@users.noreply.github.com"},{"name":"jbenet","email":"juan@benet.ai"},{"name":"nginnever","email":"ginneversource@gmail.com"},{"name":"ᴠɪᴄᴛᴏʀ ʙᴊᴇʟᴋʜᴏʟᴍ","email":"victorbjelkholm@gmail.com"}],"gitHead":"bb17a2dde56ad7a1b7b730332589f82b5e60f2f1","_id":"ipfs-unixfs-exporter@0.35.8","_npmVersion":"6.4.1","_nodeVersion":"10.14.2","_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"dist":{"integrity":"sha512-JxYAe2w4jtRUWjVcGFeRixaoD9Kw7d9jEO0cmTPi2wOSCAAAI/7DP9E6ErHdUFSh1Xoect87ppgjGpEVo3U4xg==","shasum":"3e53dc1c255e64ec19f7be7c6f38b78fe209002f","tarball":"http://registry-npm.ywwl.com/ipfs-unixfs-exporter/download/ipfs-unixfs-exporter-0.35.8.tgz","fileCount":20,"unpackedSize":2529140,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcPz/5CRA9TVsSAnZWagAAwnkP/ih76jwx05ztyj33aI9Z\npfhmotGOBUzeuQFfCR4oMYMNzODwALo07Tue06OT0PwOr+dxzw+69NcyUAqT\n74g4mJwPwqEInutlng+xA94b42g7XmkCnVHOe3mh0ZvHWpmPPfSscp1x0vMT\nLiqw9FU4xoUj+RyPTwedScHUKgzgldNqibNgJ/5z73/1022J+VS/YmuNty82\nrn590WzBWNVjKhFcCpaSTmwVjAAEoAzng0MhgNqbmf8sSYEFPJOd+OEYADjC\nCs9ThI5bOeqyihc/j9zTmoNKT0WIuuXCvA0Ia9IYQkyKbiopCFPO0wwCQp72\nKgu93/VCT+U5EUGoqkihP7hjTiv9Eb1ZDlFfkuPisnaZL5gJfwv8Jbry/mcE\n/eOrAuMzgh7ReBVdJSzgw7HjBkWp0L8Wk7CmlH3yabFqk+9L8Trg+UGIX9HE\nMGWYKtt9Gqb5c6+9vyaiHxoeH+k+B6NbZvoj9Ol18oWaX3t5V2ikaOt5LedY\nE5eLLDekBpDbZdllqeTuKuXZLgNcokke2jJp2UfIAPoDDj0RClF0u0c9Cq32\nzeI3De0aZi6eBZD96rpJFrmXL9dN3TQi9/hFiMlfdegTE6FF9AzZyDW510k4\nGhbYq8u43xGLG0iyKSTOAjJev6SLWjC6BEm1JNR64+xh8tMqv15zFfiSmGID\nudSR\r\n=OMit\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIACejz/8mVnyzXggAXIKzbw5iXBDCBCfn+lkT6O7kfLWAiAIz0YkK4ooCLN7T4MGN9CbGSAi63xiVra1YfD14TGh4w=="}],"size":560572,"noattachment":false,"key":"/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-0.35.8.tgz"},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ipfs-unixfs-exporter_0.35.8_1547649016936_0.3064451434580697"},"_hasShrinkwrap":false,"readme":"# ipfs-unixfs-exporter <!-- omit in toc -->\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-ipfs-unixfs.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-unixfs)\n[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/js-ipfs-unixfs/js-test-and-release.yml?branch=master\\&style=flat-square)](https://github.com/ipfs/js-ipfs-unixfs/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)\n\n> JavaScript implementation of the UnixFs exporter used by IPFS\n\n# About\n\nThe UnixFS Exporter provides a means to read DAGs from a blockstore given a CID.\n\n## Example\n\n```js\n// import a file and export it again\nimport { importer } from 'ipfs-unixfs-importer'\nimport { exporter } from 'ipfs-unixfs-exporter'\nimport { MemoryBlockstore } from 'blockstore-core/memory'\n\n// Should contain the blocks we are trying to export\nconst blockstore = new MemoryBlockstore()\nconst files = []\n\nfor await (const file of importer([{\n  path: '/foo/bar.txt',\n  content: new Uint8Array([0, 1, 2, 3])\n}], blockstore)) {\n  files.push(file)\n}\n\nconsole.info(files[0].cid) // Qmbaz\n\nconst entry = await exporter(files[0].cid, blockstore)\n\nconsole.info(entry.cid) // Qmqux\nconsole.info(entry.path) // Qmbaz/foo/bar.txt\nconsole.info(entry.name) // bar.txt\nconsole.info(entry.unixfs.fileSize()) // 4\n\n// stream content from unixfs node\nconst size = entry.unixfs.fileSize()\nconst bytes = new Uint8Array(size)\nlet offset = 0\n\nfor await (const buf of entry.content()) {\n  bytes.set(buf, offset)\n  offset += chunk.length\n}\n\nconsole.info(bytes) // 0, 1, 2, 3\n```\n\n# Install\n\n```console\n$ npm i ipfs-unixfs-exporter\n```\n\n## Browser `<script>` tag\n\nLoading this module through a script tag will make it's exports available as `IpfsUnixfsExporter` in the global namespace.\n\n```html\n<script src=\"https://unpkg.com/ipfs-unixfs-exporter/dist/index.min.js\"></script>\n```\n\n# API Docs\n\n- <https://ipfs.github.io/js-ipfs-unixfs/modules/ipfs_unixfs_exporter.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-ipfs-unixfs/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\n[dag API]: https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/DAG.md\n\n[blockstore]: https://github.com/ipfs/js-ipfs-interfaces/tree/master/packages/interface-blockstore#readme\n\n[UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs\n","publish_time":1547649017115,"_cnpm_publish_time":1547649017115,"dist-tags":{"latest":"16.2.3","next":"7.0.7-rc.7"}}