{"name":"ipfs-unixfs-exporter","version":"14.0.2","keywords":["IPFS"],"license":"Apache-2.0 OR MIT","_id":"ipfs-unixfs-exporter@14.0.2","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@ipfs.tech"}],"homepage":"https://github.com/ipfs/js-ipfs-unixfs/tree/main/packages/ipfs-unixfs-exporter#readme","bugs":{"url":"https://github.com/ipfs/js-ipfs-unixfs/issues"},"dist":{"shasum":"8d0345286baba3e346f575727bd36f2fa44f2dc4","tarball":"http://registry-npm.ywwl.com/ipfs-unixfs-exporter/download/ipfs-unixfs-exporter-14.0.2.tgz","fileCount":95,"integrity":"sha512-f8XeDrpPS2YNsSHI3aT9IcsVBHcaExLAuEafZTXCWqMk/vJnwAkna6trGPlUXjf+8gaYwCoIaS0gUGlTz45UUQ==","signatures":[{"sig":"MEYCIQD6EJCaCH0RAu2hHakyZCGpxB9ca3hOqnnqnn069yg4uwIhANL5jr/OtPqXBYMCaObzednHdp893O6JIpe3KcjhA09P","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/ipfs-unixfs-exporter@14.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":877316,"size":208170,"noattachment":false,"key":"/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-14.0.2.tgz"},"type":"module","types":"./dist/src/index.d.ts","browser":{"fs":false,"readable-stream":false},"exports":{".":{"types":"./dist/src/index.d.ts","import":"./dist/src/index.js"}},"gitHead":"f7c7064d19484f267251904683edc80864ed131b","release":{"plugins":[["@semantic-release/commit-analyzer",{"preset":"conventionalcommits","releaseRules":[{"release":"major","breaking":true},{"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",{"assets":["CHANGELOG.md","package.json"]}]],"branches":["main"]},"scripts":{"lint":"aegir lint","test":"aegir test","build":"aegir build","clean":"aegir clean","release":"aegir release","dep-check":"aegir dep-check","doc-check":"aegir doc-check","test:node":"aegir test -t node --cov","test:chrome":"aegir test -t browser --cov","test:firefox":"aegir test -t browser -- --browser firefox"},"_npmUser":{"name":"npm-service-account-ipfs","email":"npm-service-account+ipfs@ipfs.tech"},"repository":{"url":"git+https://github.com/ipfs/js-ipfs-unixfs.git","type":"git"},"_npmVersion":"10.9.4","description":"JavaScript implementation of the UnixFs exporter used by IPFS","directories":{},"sideEffects":false,"_nodeVersion":"24.11.1","dependencies":{"it-map":"^3.1.4","it-last":"^3.0.9","it-pipe":"^3.0.1","p-queue":"^9.0.0","it-filter":"^3.1.4","ipfs-unixfs":"^12.0.0","it-parallel":"^3.0.13","it-pushable":"^3.2.3","@ipld/dag-pb":"^4.1.5","it-to-buffer":"^4.0.10","multiformats":"^13.3.7","hamt-sharding":"^3.0.6","@ipld/dag-cbor":"^9.2.4","@ipld/dag-json":"^10.2.5","progress-events":"^1.0.1","interface-blockstore":"^6.0.1","@multiformats/murmur3":"^2.1.8"},"publishConfig":{"access":"public","provenance":true},"_hasShrinkwrap":false,"devDependencies":{"aegir":"^47.0.16","delay":"^7.0.0","sinon":"^21.0.0","it-all":"^3.0.9","it-drain":"^3.0.10","it-first":"^3.0.9","wherearewe":"^2.0.1","uint8arrays":"^5.1.0","@types/sinon":"^21.0.0","merge-options":"^3.0.4","blockstore-core":"^6.0.2","readable-stream":"^4.7.0","it-buffer-stream":"^3.0.11","iso-random-stream":"^2.0.2","ipfs-unixfs-importer":"^16.0.0","@types/readable-stream":"^4.0.21"},"_npmOperationalInternal":{"tmp":"tmp/ipfs-unixfs-exporter_14.0.2_1765383483919_0.7200034603207055","host":"s3://npm-registry-packages-npm-production"},"readme":"# ipfs-unixfs-exporter\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=main\\&style=flat-square)](https://github.com/ipfs/js-ipfs-unixfs/actions/workflows/js-test-and-release.yml?query=branch%3Amain)\n\n> JavaScript implementation of the UnixFs exporter used by IPFS\n\n# About\n\n<!--\n\n!IMPORTANT!\n\nEverything in this README between \"# About\" and \"# Install\" is automatically\ngenerated and will be overwritten the next time the doc generator is run.\n\nTo make changes to this section, please update the @packageDocumentation section\nof src/index.js or src/index.ts\n\nTo experiment with formatting, please run \"npm run docs\" from the root of this\nrepo and examine the changes made.\n\n-->\n\nThe UnixFS Exporter provides a means to read DAGs from a blockstore given a\nCID.\n\n## Example\n\n```TypeScript\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\nif (entry.type !== 'file') {\n  throw new Error('Unexpected entry type')\n}\n\nconsole.info(entry.cid) // Qmqux\nconsole.info(entry.unixfs.fileSize()) // 4\n\n// stream content from unixfs node\nconst size = entry.unixfs.fileSize()\nconst bytes = new Uint8Array(Number(size))\nlet offset = 0\n\nfor await (const buf of entry.content()) {\n  bytes.set(buf, offset)\n  offset += buf.byteLength\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 its 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](https://github.com/ipfs/js-ipfs-unixfs/blob/main/packages/ipfs-unixfs-exporter/LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)\n- MIT ([LICENSE-MIT](https://github.com/ipfs/js-ipfs-unixfs/blob/main/packages/ipfs-unixfs-exporter/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","publish_time":1765383484100,"_cnpm_publish_time":1765383484100,"dist-tags":{"latest":"16.2.3","next":"7.0.7-rc.7"}}