{"name":"ipfs-unixfs-exporter","version":"6.0.0","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":{"prepare":"aegir build --no-bundle","test":"aegir test","build":"aegir build","clean":"rimraf ./dist","lint":"aegir ts -p check && aegir lint","coverage":"nyc -s npm run test -t node && nyc report --reporter=html","depcheck":"aegir dep-check -i @types/mocha -i @types/sinon -i nyc -i abort-controller -i rimraf -i copy -i util -i crypto-browserify -i events -i readable-stream -i interface-blockstore"},"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":">=14.0.0","npm":">=7.0.0"},"homepage":"https://github.com/ipfs/js-ipfs-unixfs#readme","devDependencies":{"@types/mocha":"^8.2.1","@types/sinon":"^10.0.0","abort-controller":"^3.0.0","aegir":"^34.0.0","copy":"^0.3.2","crypto-browserify":"^3.12.0","detect-node":"^2.0.4","events":"^3.3.0","ipfs-unixfs-importer":"^8.0.0","it-all":"^1.0.5","it-buffer-stream":"^2.0.0","it-first":"^1.0.6","merge-options":"^3.0.4","murmurhash3js-revisited":"^3.0.0","native-abort-controller":"^1.0.3","nyc":"^15.0.0","readable-stream":"^3.6.0","rimraf":"^3.0.2","sinon":"^11.1.1","uint8arrays":"^2.1.2","util":"^0.12.3"},"dependencies":{"@ipld/dag-cbor":"^6.0.4","@ipld/dag-pb":"^2.0.2","err-code":"^3.0.1","hamt-sharding":"^2.0.0","interface-blockstore":"^1.0.0","ipfs-unixfs":"^5.0.0","it-last":"^1.0.5","multiformats":"^9.0.4","murmurhash3js-revisited":"^3.0.0","uint8arrays":"^2.1.5"},"types":"dist/src/index.d.ts","eslintConfig":{"extends":"ipfs"},"gitHead":"dedbd82c3ac4f6f1dc40cd084453b627abdcfc36","_id":"ipfs-unixfs-exporter@6.0.0","_nodeVersion":"16.3.0","_npmVersion":"lerna/3.22.1/node@v16.3.0+x64 (darwin)","dist":{"integrity":"sha512-pRRZ2eJyAS3zPf0lxIdjHmV5wDVv2TOOmvbzdZ10VK41dTlMQfKY3/F9oFXZt4vFitL8XV12tz6CEPSp6XTVIQ==","shasum":"5b2ed69b03f3803ce2742d8db130eb0ee0fce38a","tarball":"http://registry-npm.ywwl.com/ipfs-unixfs-exporter/download/ipfs-unixfs-exporter-6.0.0.tgz","fileCount":45,"unpackedSize":79962,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg6Hk3CRA9TVsSAnZWagAAuSUQAJepzXlzUFfH6gzwdQKe\ntcufqV9yrVJs8dymYh1IR3BZk/Ia5ACF7W5IYJyNbg16K6tM2KNzdQTHC5xL\nOefGlAM9YUU0ipoqDjvw2HAYjha8WTuqVyWIR0QzIxNOvJ9D2vEmqaMpX7uz\nStEgYmj5F1eMgMyKSbpLzfsoSgLT0AGr9j2fmjNPuBsOqhwedhn9sfM7OfsB\nQBZ75PfUw3Oazo2b3gGBJWIWotW4DVkcZiBbZEbGQZn/ca6Gbs8NFgqRLG52\nVnSTD5Gx2fukTYMYYSFtz4gtQnkj1Z2aMvVEyxMGpIGCkB+6Y68/HVfYrFpc\n6v6b1O0urJA68lJHDOQGfQskd12EMKDLTfizjVZzHKdsuB5vA0wOZFQNrOgS\nfVYooCxV94nzFVelw208c+lH+2hZgTGOIdSjvn2QrFJK1QyazC2OGtCpf8ND\ndDvHEftqhzsaNO43XdPn+IuGE0KlDZLp1ZPl9vimWQgYpNWmzJv0wV6MbPdm\nwmYda3O0jPu5ovGQ1H9hk9OnseoGpE+ryuU4nDx45XZq5G00mvtVXy6x3hwL\nj+USMLpXg0ZLKDMSLaa0plhYTks6FtyxT/L01FbWxlZMP6GQwEKMGhGIuj82\nqWy5q5x8LcUx8vbDzNvucIXKznqIy6X3OYK/jsPRJlJ2tykvicX92w/2c6Xx\nL3FY\r\n=mh0L\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAax8On8gZFIIqYgoD3/xoGZnVjIxF/Sljt/FHdIOHSsAiAus82WcJc9+5ztVyrUQREwcN2nzI+nNUqJhXr3AV3Jww=="}],"size":18844,"noattachment":false,"key":"/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-6.0.0.tgz"},"_npmUser":{"name":"achingbrain","email":"alex@achingbrain.net"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"ipfs-npm-publisher-bot","email":"alex.potsides+ipfs-npm-publisher-bot@protocol.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ipfs-unixfs-exporter_6.0.0_1625848118812_0.8563998788603655"},"_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":1625848118950,"_cnpm_publish_time":1625848118950,"dist-tags":{"latest":"16.2.3","next":"7.0.7-rc.7"}}