{"name":"ipfs-unixfs-exporter","version":"2.0.1","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","clean":"rm -rf ./dist","lint":"aegir lint","coverage":"nyc -s npm run test:node && nyc report --reporter=html","depcheck":"aegir dep-check"},"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-unixfs.git"},"keywords":["IPFS"],"license":"MIT","bugs":{"url":"https://github.com/ipfs/js-ipfs-unixfs/issues"},"engines":{"node":">=10.0.0","npm":">=4.0.0"},"homepage":"https://github.com/ipfs/js-ipfs-unixfs#readme","devDependencies":{"abort-controller":"^3.0.0","aegir":"^21.9.0","chai":"^4.2.0","chai-as-promised":"^7.1.1","detect-node":"^2.0.4","dirty-chai":"^2.0.1","ipfs-unixfs-importer":"^2.0.1","ipld":"^0.26.1","ipld-dag-pb":"^0.18.5","ipld-in-memory":"^4.0.0","it-all":"^1.0.1","it-buffer-stream":"^1.0.2","it-first":"^1.0.1","multicodec":"^1.0.0","nyc":"^15.0.0","sinon":"^9.0.1"},"dependencies":{"buffer":"^5.6.0","cids":"^0.8.0","err-code":"^2.0.0","hamt-sharding":"^1.0.0","ipfs-unixfs":"^1.0.2","it-last":"^1.0.1","multihashing-async":"^0.8.0"},"gitHead":"49c8c54a136d8b2fdfd4795de460b5e2eb374e86","_id":"ipfs-unixfs-exporter@2.0.1","_nodeVersion":"12.16.1","_npmVersion":"lerna/3.20.2/node@v12.16.1+x64 (darwin)","dist":{"integrity":"sha512-DyXM/D7I/dquiXP9HS1MsPwJZYht1KjJkRncgzHstQ6fepKPlC28n1cbPr43/JfYG0GfI5sjhvSI7w3XEou+PQ==","shasum":"b182b759b23ca40683bab97f56c365c60d43333f","tarball":"http://registry-npm.ywwl.com/ipfs-unixfs-exporter/download/ipfs-unixfs-exporter-2.0.1.tgz","fileCount":49,"unpackedSize":1656359,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeow8aCRA9TVsSAnZWagAAi0EP/jFfkILDa1kmzdLxDYE3\nwxeRKlGw4Nf35ifPFqV/Ek2TuVHKlOA0iBdCeWqf58DDYrAFaaS8vG7EfXUg\nOFJNIyLwILbXRYy5ofijpHvDH6fHK2QvsNTEay03ffBB5B1lKkfi4WqbvY+L\nc4eSdEoIjXtg4V+wLlsa/U9D50u4y3XnusAYPAb96F2ydx2ZgHTySaCY2Qch\nn1wQWTO5+zP8kHZnZ+8NcIaq7W+UqiA4yC4gHiPeyP69ifFR9GhV8loGXcph\nQYVrrrBg2o18ddzz4iC96agUaIpVA3sYE4ZfTw+/iY6Hk7utzKquRG7V32v5\nF0g6swc0GndTTy9Ep32dwlWGt0tu+zi42CQdov2IVGF+Xp82kBc9nHO5uBkY\nLSQDDO+uyBwsQYIxH6G/eWnTospXf59uSOloHqpuGjGi17nI0FO1dAcxnPxm\nkvstbG3auwzs+YnrvPlWL+0efohDEElsnlY3ygVL0WJ35fukoP8p3dzXLTOV\nZvEj4hCNh0YhxPrRNNiXUM4f5qV/Tu1ew3uQTk5C5nFcDLuyM9bS+DKLbJiN\np8UFg6EZi4x3lZUpgC0MYpr/f0Bs+c2+FOfLv+2Iyhj80NnGNcAO6i0kN1GD\n2lcINk6c4L/A90ZNEhCkMcBaEi8fZ3Jv929eFJPyGURsbT9VOsQS5uMPCCAu\nnPPV\r\n=FVhT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxzxyR8gtT1GGXobVuEiFzN0heyVs4AK9rIUJhNVJ0sAIhANYDFYiw4AEfClMd5qWxdB1m0DA4xSd97M7ky4MfFMKC"}],"size":1235777,"noattachment":false,"key":"/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-2.0.1.tgz"},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"}],"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ipfs-unixfs-exporter_2.0.1_1587744537977_0.35803333436810725"},"_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":1587744538214,"_cnpm_publish_time":1587744538214,"dist-tags":{"latest":"16.2.3","next":"7.0.7-rc.7"}}