{"name":"ipfs-unixfs-exporter","version":"13.0.3","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"},"type":"module","types":"./dist/src/index.d.ts","exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/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":"docs","release":"patch"},{"type":"test","release":"patch"},{"type":"deps","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":"Documentation"},{"type":"deps","section":"Dependencies"},{"type":"test","section":"Tests"}]}}],"@semantic-release/changelog","@semantic-release/npm","@semantic-release/github","@semantic-release/git"]},"scripts":{"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","clean":"aegir clean","lint":"aegir lint","dep-check":"aegir dep-check","release":"aegir release"},"dependencies":{"@ipld/dag-cbor":"^9.0.0","@ipld/dag-pb":"^4.0.0","@multiformats/murmur3":"^2.0.0","err-code":"^3.0.1","hamt-sharding":"^3.0.0","interface-blockstore":"^5.0.0","ipfs-unixfs":"^11.0.0","it-filter":"^2.0.0","it-last":"^2.0.0","it-map":"^2.0.0","it-parallel":"^3.0.0","it-pipe":"^2.0.4","it-pushable":"^3.1.0","multiformats":"^11.0.0","p-queue":"^7.3.0","progress-events":"^1.0.0","uint8arrays":"^4.0.2"},"devDependencies":{"@types/sinon":"^10.0.0","aegir":"^38.1.2","blockstore-core":"^4.0.1","delay":"^5.0.0","ipfs-unixfs-importer":"^15.0.0","it-all":"^2.0.0","it-buffer-stream":"^3.0.0","it-first":"^2.0.0","merge-options":"^3.0.4","sinon":"^15.0.0"},"browser":{"fs":false},"typedoc":{"entryPoint":"./src/index.ts"},"gitHead":"d579997e59739a1c80dede043a52f7cd234d8908","_id":"ipfs-unixfs-exporter@13.0.3","_nodeVersion":"18.15.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-4Jrv5OWlyfYXwK7xbHAje2bJ0Sqk9Yo2XuvcHSqMK2bw1g7h8oifLqhgHAoCMqPY+Y6fv34BaEeSINN3ko995A==","shasum":"4758d8a8287ae82deb0522ea41d1d0286fe8db13","tarball":"http://registry-npm.ywwl.com/ipfs-unixfs-exporter/download/ipfs-unixfs-exporter-13.0.3.tgz","fileCount":70,"unpackedSize":203942,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDt9+90RGMTz3KQJZRNNkKJq4UxrspCkOYTTV+yAbpIEgIgKBNNRWiwQ2vc139LDn4xj5nkiQO1U/u8mJ78UT9QwJ0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEgtfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmov1g/9HuO54g6oAcUbLvpg2h5TyhZJWGJrjfCuiOZztlKv22o5cc7R\r\nbRw+4l+ksinnksNet/mYRH33945IxUmvvldLelE6HgjPIQv7DyLP1A0wd3dG\r\n/fZJDw6Tf92Mw3yH0bbgaaXPKLa3z740/2rg99821wuSutWYPmoGkKHc8nN9\r\nlg+hxg2CTA1he0NPtRJ2fykOp3J1JOFQUcFqE+Q5GL8+G7xq3uL06M9L4C2H\r\nMBEW8nTT1e0su0QlDPodas7yd2638drrqWrQtX6auzE16Q6L8I0T/aFbRgFF\r\n8M8utGK3zGHZAn6HN6FGkg/7Ey3LHx8OR8T5fbqh0F2YPS1VExjf3FUI4vWD\r\nJ6iSywQ7YingcUiI0XWv5E+frq7LZAE9dCJz9slJRE6ear040WChSggAgs47\r\ncZ6/8Vcafm6FQ6AxzimJ7y+fXhoYE29DnQ2zzGwyy5y3DZUHXp9h4Qnk6CA3\r\nrGYiV1plRgycLwMFkfJCxJa/9PfZUsksr0L8H/P590ewfGGAxBR5tp4Fc9bQ\r\nEQnt7PTR7yN7a35Mhc9O2FurODR5Fr/OlTTzPhdLplOJ2e2M4NKDR0AW1x+o\r\nUcIdJfQX4GYGsm4kAT97Fbi4dvC3W2GCmPTYBeUZCFfCxV3hNLIPaknmwaZx\r\nyCrIw43UtkExEZKuZgUl+v/mmLZpTlm6niY=\r\n=4N04\r\n-----END PGP SIGNATURE-----\r\n","size":57298,"noattachment":false,"key":"/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-13.0.3.tgz"},"_npmUser":{"name":"npm-service-account-ipfs","email":"npm-service-account+ipfs@protocol.ai"},"directories":{},"maintainers":[{"name":"achingbrain","email":"alex@achingbrain.net"},{"name":"ipfs-npm-publisher-bot","email":"alex.potsides+ipfs-npm-publisher-bot@protocol.ai"},{"name":"npm-service-account-ipfs","email":"npm-service-account+ipfs@protocol.ai"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ipfs-unixfs-exporter_13.0.3_1678904159300_0.46464687807112415"},"_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":1678904159546,"_cnpm_publish_time":1678904159546,"dist-tags":{"latest":"16.2.3","next":"7.0.7-rc.7"}}