{"name":"ipfs-unixfs-exporter","version":"7.0.10","description":"JavaScript implementation of the UnixFs exporter used by IPFS","license":"Apache-2.0 OR MIT","homepage":"https://github.com/ipfs/js-ipfs-unixfs/tree/master/packages/ipfs-unixfs-exporter#readme","repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-unixfs.git"},"bugs":{"url":"https://github.com/ipfs/js-ipfs-unixfs/issues"},"keywords":["IPFS"],"engines":{"node":">=16.0.0","npm":">=7.0.0"},"types":"types/src/index.d.ts","typesVersions":{"*":{"*":["types/*","types/src/*"],"types/*":["types/*","types/src/*"]}},"exports":{".":{"browser":"./esm/src/index.js","require":"./cjs/src/index.js","import":"./esm/src/index.js"}},"eslintConfig":{"extends":"ipfs","parserOptions":{"sourceType":"module"}},"release":{"branches":["master"],"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"breaking":true,"release":"major"},{"revert":true,"release":"patch"},{"type":"feat","release":"minor"},{"type":"fix","release":"patch"},{"type":"chore","release":"patch"},{"type":"docs","release":"patch"},{"type":"test","release":"patch"},{"scope":"no-release","release":false}]}],["@semantic-release/release-notes-generator",{"preset":"conventionalcommits","presetConfig":{"types":[{"type":"feat","section":"Features"},{"type":"fix","section":"Bug Fixes"},{"type":"chore","section":"Trivial Changes"},{"type":"docs","section":"Trivial Changes"},{"type":"test","section":"Tests"}]}}],"@semantic-release/changelog",["@semantic-release/npm",{"pkgRoot":"dist"}],"@semantic-release/github","@semantic-release/git"]},"scripts":{"prepare":"aegir build --no-bundle && cp -R types dist","pretest":"aegir build --esm-tests","test":"aegir test","test:node":"aegir test -t node --cov","test:chrome":"aegir test -t browser --cov","test:firefox":"aegir test -t browser -- --browser firefox","build":"aegir build && cp -R types dist","preleaseOnly":"npx json -I -f dist/package.json -e this.types='\"src/index.d.ts\"'","clean":"rimraf ./dist","lint":"aegir ts -p check && aegir lint","coverage":"nyc -s npm run test -t node && nyc report --reporter=html","dep-check":"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","release":"semantic-release"},"dependencies":{"@ipld/dag-cbor":"^7.0.2","@ipld/dag-pb":"^2.0.2","@multiformats/murmur3":"^1.0.3","err-code":"^3.0.1","hamt-sharding":"^2.0.0","interface-blockstore":"^2.0.3","ipfs-unixfs":"^6.0.0","it-last":"^1.0.5","multiformats":"^9.4.2","uint8arrays":"^3.0.0"},"devDependencies":{"@types/sinon":"^10.0.0","abort-controller":"^3.0.0","aegir":"^36.2.3","blockstore-core":"^1.0.5","copy":"^0.3.2","crypto-browserify":"^3.12.0","events":"^3.3.0","ipfs-unixfs-importer":"^9.0.0","it-all":"^1.0.5","it-buffer-stream":"^2.0.0","it-first":"^1.0.6","merge-options":"^3.0.4","native-abort-controller":"^1.0.3","nyc":"^15.0.0","readable-stream":"^3.6.0","rimraf":"^3.0.2","sinon":"^14.0.0","util":"^0.12.3"},"browser":{".":"./cjs/src/index.js"},"main":"./cjs/src/index.js","publishConfig":{"directory":"dist"},"gitHead":"83e289e66356c7eb73deec18cdea168642fd1d80","_id":"ipfs-unixfs-exporter@7.0.10","_nodeVersion":"16.15.0","_npmVersion":"7.24.2","dist":{"integrity":"sha512-zU+IeJJMCdOUv6TWiTYgUyNn6J8JJoqSGXBcr88fCEE7LcXgIPNUEYDPQVHyzFJK4smRswrP88NY7HjMn9naMA==","shasum":"1372472bc03a20697cc6352146d69bc7bbedd139","tarball":"http://registry-npm.ywwl.com/ipfs-unixfs-exporter/download/ipfs-unixfs-exporter-7.0.10.tgz","fileCount":88,"unpackedSize":185724,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDR+ddObCQxkmUyDGj2l0MJWSDmr/iOtOIAusTzMI+iUQIgLztZbDyAvT9XXY8RwrR6KMCbmmbyZg6aWoPNEFQGT7c="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJikLo+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBzhAAjYoUzIDeCKPcSj03dZNPyjN4r4CGzMPHiN98wpEnTkrmkbUN\r\n4D7tvDjtzDOJDiZyBRFzBSw2wYZWP74KmE/W23nwuayZyKaJYfy8UUtaA7yk\r\nCh/riJ4a9NhmvV2z+U9WVPkuUr0wnNbaU54ilVgeZnUHiJfLwrW6GphFbUWH\r\nN8zqQKR/eWhRqSTXnst8czhVQJUjqnwnM6qQtfqeSLa9boCp9zDTdudEKc8M\r\nCq8SktE0gzCmsIHbw5Dvn2b0hYv2d7GOF/yMT1cpDiG1QmK2Lbey+/O9YSvL\r\nr0izeVuzkrMv+9iYD8rrgXEO9cX0jZgOlBxEDP50pJmfceFqkBeyA9U1YaYI\r\n2jopiI7v8zZSyM8HmD9vA//8mfCTf1p5yUkjzMEsAzkmIUoFhndgJ6uCrR8n\r\nBebzpHBGTfzcIPMwTkx+D/z0ITxWkkCdz5gTW2HOIJdz/ddjtd9VqM/XhrTu\r\nddBwijAbn2MZeB4aDWuOk+OR8fH03i6ABH9oDsNMpIpRPrVe/zhIUTbYzWtV\r\nzAPOJSHExdMbm6ke60abwDmskKug7TfZfBcpwHo9Vb27UVu6s3BcHjZwwYl5\r\nV2TWImvzJg9LuPjFrGUBBuPQVbR5VHMzb+kzLURdfOz+fu4tMaH0+co0Rm6+\r\nmUp9WdplDuJvvDwkOtcvcM1j2yV1STFGqqs=\r\n=DCYr\r\n-----END PGP SIGNATURE-----\r\n","size":47485,"noattachment":false,"key":"/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-7.0.10.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_7.0.10_1653652030553_0.22788783703405557"},"_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":1653652030836,"_cnpm_publish_time":1653652030836,"dist-tags":{"latest":"16.2.3","next":"7.0.7-rc.7"}}