{"_id":"@vascosantos/ipfs-unixfs-exporter","_rev":"3-01a0de79898a5ac43541879fefbb2d03","name":"@vascosantos/ipfs-unixfs-exporter","dist-tags":{"latest":"8.0.0"},"versions":{"6.0.0":{"name":"@vascosantos/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 --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 ipfs-core-types -i copy -i util -i crypto-browserify -i events -i readable-stream"},"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":"^33.1.0","copy":"^0.3.2","crypto-browserify":"^3.12.0","detect-node":"^2.0.4","events":"^3.3.0","ipfs-core-types":"^0.3.1","ipfs-unixfs-importer":"../ipfs-unixfs-importer","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":"^10.0.0","uint8arrays":"^2.1.2","util":"^0.12.3"},"dependencies":{"@ipld/dag-cbor":"^5.0.0","@ipld/dag-pb":"^1.1.0","err-code":"^3.0.1","hamt-sharding":"^2.0.0","ipfs-unixfs":"^4.0.3","it-last":"^1.0.5","multicodec":"^3.0.1","multiformats":"^8.0.3","multihashing-async":"^2.1.0"},"types":"dist/src/index.d.ts","eslintConfig":{"extends":"ipfs"},"_id":"@vascosantos/ipfs-unixfs-exporter@6.0.0","_nodeVersion":"16.2.0","_npmVersion":"7.13.0","dist":{"integrity":"sha512-kzgvf2DFnRYpn+M+TcFiiQwitHBSCav+X0KfLI/g0ms/SBYFg6B3e+HhuKwoDCh/SBz4fYauNYvcEefeqbo2/A==","shasum":"015c277c353c287f4127b226b53c767c034db9e3","tarball":"https://registry.npmjs.org/@vascosantos/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-6.0.0.tgz","fileCount":44,"unpackedSize":50617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgyb+fCRA9TVsSAnZWagAAJggQAIE/xueHZ1Kuy+QPk9RN\nyiGO/pmvm0PAHFcRtwAdk10SsrhHXgpGxTNHnwqsygDiIzQ5YgTeoIk/F587\nMWf/yCi3C96GhgaeOAKgP51Mg+3nSZeHLUdG/Dfi6QQVNUtUt1ShkpRmL2D7\nQAdhN7wfYZgHQxV3tYsBCUvI1PbVzHCboWB0Rz0hL/RQy4evx0GBtiJB6lcr\ncSWibiYQJ6tdz2KCM59fcKFJGs39BJc+vD6/tWbeQLqSeGRuEPCXDuj3VX+F\ns5WQieQ9Krg3HUb3ghRPqcirhqui3MiEJVY/SU6SMHLnLALjp8+veB8r6udM\nfzAiJISmsO8SBqPPBfTWuQK2oBQJJze4DAqCiEFke4z0J/RZWYuZyhTWCZWu\nu5aI0ALn4Ik/q7fZgqIEV0Q0LFBXt/dOn2h3RYN6Izj6e5EY4iSrHuJERhGH\noRFP7YpkkDlrz48QJgThIQ/OiuUPDQnpCiCnGP9rW/knZHeSdOlTcYpjJB1s\nNyVfuS+DVgBlA7eTPaKM+i7S6/lF9r6HcDM16Z4AmNJfJ8chWDJ0usqJ9nnq\nf+qj7suR28jCK6LYL6t6eM4uO48QJomBCYVHTRFj+xompxbEfELwB1XJ+hzz\nTmGT8l7tw0+QfBhvItqAeCkuW3gdN4Gz8SQn4iDXkrlp/7EFnnNuSbRk7aW7\nldRu\r\n=Lq+f\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvnNHtaQ3kZiCdn/EgPwOG2nIwlZLR7j0gmuCZ3kVFMgIgGRwd9nB52jpAknIE63uyOTi0iVEumM6U7H8lt57KtiA="}]},"_npmUser":{"name":"vascosantos","email":"vasco.santos@moxy.studio"},"directories":{},"maintainers":[{"name":"vascosantos","email":"vasco.santos@moxy.studio"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ipfs-unixfs-exporter_6.0.0_1623834526932_0.9402583360425525"},"_hasShrinkwrap":false},"7.0.0":{"name":"@vascosantos/ipfs-unixfs-exporter","version":"7.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 --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 ipfs-core-types -i copy -i util -i crypto-browserify -i events -i readable-stream"},"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":"^33.1.0","copy":"^0.3.2","crypto-browserify":"^3.12.0","detect-node":"^2.0.4","events":"^3.3.0","ipfs-core-types":"^0.3.1","ipfs-unixfs-importer":"../ipfs-unixfs-importer","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":"^10.0.0","uint8arrays":"^2.1.2","util":"^0.12.3"},"dependencies":{"@ipld/dag-cbor":"^6.0.0","@ipld/dag-pb":"^2.0.2","err-code":"^3.0.1","hamt-sharding":"^2.0.0","ipfs-unixfs":"^4.0.3","it-last":"^1.0.5","multicodec":"^3.0.1","multiformats":"^9.0.4","multihashing-async":"^2.1.0"},"types":"dist/src/index.d.ts","eslintConfig":{"extends":"ipfs"},"_id":"@vascosantos/ipfs-unixfs-exporter@7.0.0","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-2lt5wbmVq5wPiY89mGyVQ+z7HuEH4V6hbrwe/dCZOMZdZ1tat6uFvelHd6llHMxvlKalmcU2/QtUPjSDKX+/KQ==","shasum":"ae2b08f1cc639d1365fab176133237c87a806fb7","tarball":"https://registry.npmjs.org/@vascosantos/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-7.0.0.tgz","fileCount":44,"unpackedSize":50617,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgzGh+CRA9TVsSAnZWagAAtawP/A5ooyv7/saJiLPjXGcO\n3ldBoP79vILEujT+Wb345brONasEb6jI08d48LLr/XDaguJPBV1yBi0u1J5B\nTx+hHGaCmaBS5bOXxecf1r2Z1iXJsxCrAhBet0hoRQeCm7GbpbTdqvETLx58\n/8xvxR4H008FLadZbLkEHBe1fTXRLTww+erciFw4JZLSTnRA8sdXxw03v/le\n6hlPOpqD7yPCTOA0Y616hCNEyKfhHG3pZ0qrtTk/veHutdut/KtypkuNpx1T\nwGlGa9d+oxZ46uDM2UI6iowih42Baor6IQv5vQ5v4UO86FBeJfiDmEDhDM0l\n8htNwiQDnPo3k+Kx0sPT1kqE+0V06SQprwynaCbMQsmTB6Maz/QwF5exRPCb\n3E7ugpNJf0MLhg+gcd74Vbzaf298Qo0dnCddu+ux6/iiW0GOfXkJHLhQdJf4\nvDGhoL9MtHp99oNQLVyDb7rPDpb+1DEuVeuiBzDGZ43Y4yRQvg0YOTAzRTqo\nBu3n1cTzSY9+1UOd7Guc23K4Q6mWdq8LATu9hYKltMyplyJXe3QPWnAaCPHN\nf93mcxDtKNvWovYW1UCB2ON7rJdRLk9pan27U6s2O9Qu27TPQtoz7pWj9po0\nOAMdKKQDyaKNULkB0I+60W6BRNGlgtA+4iIaNc/+Wn+GxhB7X99s/xLsiEEk\nOb5l\r\n=9x6c\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCAtOlPitPBt+acscQ8yMQRHbi6vZ2CHTpUo0R3cn3RqgIgIHllJ5eaZZVBWDBzQ/Cr+LsqPMeKjw3my5U8LqHR06U="}]},"_npmUser":{"name":"vascosantos","email":"vasco.santos@moxy.studio"},"directories":{},"maintainers":[{"name":"vascosantos","email":"vasco.santos@moxy.studio"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ipfs-unixfs-exporter_7.0.0_1624008830451_0.7122013701680712"},"_hasShrinkwrap":false},"8.0.0":{"name":"@vascosantos/ipfs-unixfs-exporter","version":"8.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 --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 ipfs-core-types -i copy -i util -i crypto-browserify -i events -i readable-stream"},"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":"^33.1.0","copy":"^0.3.2","crypto-browserify":"^3.12.0","detect-node":"^2.0.4","events":"^3.3.0","ipfs-core-types":"^0.3.1","ipfs-unixfs-importer":"../ipfs-unixfs-importer","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":"^10.0.0","uint8arrays":"^2.1.2","util":"^0.12.3"},"dependencies":{"@ipld/dag-cbor":"^6.0.0","@ipld/dag-pb":"^2.0.2","err-code":"^3.0.1","hamt-sharding":"^2.0.0","ipfs-unixfs":"^4.0.3","it-last":"^1.0.5","multicodec":"^3.0.1","multiformats":"^9.0.4","multihashing-async":"^2.1.0"},"types":"dist/src/index.d.ts","eslintConfig":{"extends":"ipfs"},"_id":"@vascosantos/ipfs-unixfs-exporter@8.0.0","_nodeVersion":"16.3.0","_npmVersion":"7.15.1","dist":{"integrity":"sha512-NaPI4ybu8EqsDw3EiLLJfVtxw3uXLWeyfmS/CGRfwl82Ue6lVm2L0Ebquf1h3K1YdXhfNiaL4TKKa/ZrCX+1eA==","shasum":"6e6bae18fec1bd6173e0020a8412a8ce0a24b650","tarball":"https://registry.npmjs.org/@vascosantos/ipfs-unixfs-exporter/-/ipfs-unixfs-exporter-8.0.0.tgz","fileCount":44,"unpackedSize":50771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3I9lCRA9TVsSAnZWagAA2rwP/0n1RkZB5xchpHtH+MTp\nMgrvJk1bngT8S3xzlPxK3wqdIhX1vpXSsqZVnIKu8xjgsO7Q6Ob3m17EfWSs\npQrfKjNl2x4TJxqEQNfDJrr5OknmaZR4ZwHpB/nXn+0O/2DbiYEv6UPMPBew\nwZOHzUabEf2xG/m+IvQe/OKTmuaPfChpI6I0ocMsQpGvRiRqBxztR6He98hY\nEB7P3ni7sB2yrY1g6/LTnFs0hCb3JnaPYWW3GCU/mOxd4pwkL4avlckNzvqR\nM1aGIm9wF364e6/tmS2W1tig17/+HN/zTCpj30IAdzrFuNctEDZN9Cnl5KGa\nDcpherJjZwsBfDrKaK7gTPd2Xw0L0NSCapIcA7vXY1mDNWXi1e6buxQDeFJS\n76Bx9F35HXWBNqup+c32GbEQ8je3VffU44BqeUCHSfR/cXszcJUsQI7dLGe0\ndMTpMCfus0hhbgcgb46aOtG/dasKYjiRXdSsw7MS9daG2wpq0OlOhMdg+Buh\nt9DOk0ep+GjsOhsk5QvWdReeTCsaPNosYrrYJo8cMVpBGdsAKX7L3GaE/Uoz\ng0nif/M4O39A3dCtm5T4+s1oB3G3K3cXhiXWZpTkc6rOANGTXQc0IUj8BZQr\njxRFxcFIE/IxEcabB7nCnOrgEpWjyA9VSLiBKCrPSdjRSXY2VXavZWGnVipp\nojWe\r\n=uGBy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrulLspniMlgJoxw0I5mBm2MQVE/8SfT9K6r9ky5GotAIgLZN8HxFbFr694U6LDdrMZ1DTxNt9ziN+l1ULDdg3cMc="}]},"_npmUser":{"name":"vascosantos","email":"vasco.santos@moxy.studio"},"directories":{},"maintainers":[{"name":"vascosantos","email":"vasco.santos@moxy.studio"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ipfs-unixfs-exporter_8.0.0_1625067364545_0.8477011973776276"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-16T09:08:46.929Z","6.0.0":"2021-06-16T09:08:47.079Z","modified":"2022-04-07T10:18:46.371Z","7.0.0":"2021-06-18T09:33:50.606Z","8.0.0":"2021-06-30T15:36:04.666Z"},"maintainers":[{"name":"vascosantos","email":"vasco.santos@moxy.studio"}],"description":"JavaScript implementation of the UnixFs exporter used by IPFS","homepage":"https://github.com/ipfs/js-ipfs-unixfs#readme","keywords":["IPFS"],"repository":{"type":"git","url":"git+https://github.com/ipfs/js-ipfs-unixfs.git"},"bugs":{"url":"https://github.com/ipfs/js-ipfs-unixfs/issues"},"license":"MIT","readme":"# ipfs-unixfs-exporter\n\n[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io)\n[![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/)\n[![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)\n[![Build Status](https://flat.badgen.net/travis/ipfs/js-ipfs-unixfs)](https://travis-ci.com/ipfs/js-ipfs-unixfs)\n[![Codecov](https://codecov.io/gh/ipfs/js-ipfs-unixfs/branch/master/graph/badge.svg)](https://codecov.io/gh/ipfs/js-ipfs-unixfs)\n\n> Exports UnixFS and other DAGs from IPFS\n\n## Lead Maintainer\n\n[Alex Potsides](https://github.com/achingbrain)\n\n## Table of Contents\n\n- [ipfs-unixfs-exporter](#ipfs-unixfs-exporter)\n  - [Lead Maintainer](#lead-maintainer)\n  - [Table of Contents](#table-of-contents)\n  - [Install](#install)\n  - [Usage](#usage)\n    - [Example](#example)\n      - [API](#api)\n    - [`exporter(cid, ipld, options)`](#exportercid-ipld-options)\n      - [UnixFSEntry](#unixfsentry)\n      - [Raw entries](#raw-entries)\n      - [CBOR entries](#cbor-entries)\n      - [`entry.content({ offset, length })`](#entrycontent-offset-length-)\n    - [`walkPath(cid, ipld)`](#walkpathcid-ipld)\n    - [`recursive(cid, ipld)`](#recursivecid-ipld)\n  - [Contribute](#contribute)\n  - [License](#license)\n\n## Install\n\n```\n> npm install ipfs-unixfs-exporter\n```\n\n## Usage\n\n### Example\n\n```js\n// import a file and export it again\nconst { importer } = require('ipfs-unixfs-importer')\nconst { exporter } = require('ipfs-unixfs-exporter')\n\nconst files = []\n\nfor await (const file of importer([{\n  path: '/foo/bar.txt',\n  content: new Uint8Array([0, 1, 2, 3])\n}], ipld)) {\n  files.push(file)\n}\n\nconsole.info(files[0].cid) // Qmbaz\n\nconst entry = await exporter(files[0].cid, ipld)\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#### API\n\n```js\nconst { exporter } = require('ipfs-unixfs-exporter')\n```\n\n### `exporter(cid, ipld, options)`\n\nUses the given [ipld](https://github.com/ipld/js-ipld) instance to fetch an IPFS node by it's CID.\n\nReturns a Promise which resolves to a `UnixFSEntry`.\n\n`options` is an optional object argument that might include the following keys:\n\n- `signal` ([AbortSignal](https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal)): Used to cancel any network requests that are initiated as a result of this export\n\n#### UnixFSEntry\n\n```javascript\n{\n  type: 'file' // or 'directory'\n  name: 'foo.txt',\n  path: 'Qmbar/foo.txt',\n  cid: CID, // see https://github.com/multiformats/js-cid\n  content: function, // returns an async iterator\n  unixfs: UnixFS // see https://github.com/ipfs/js-ipfs-unixfs\n}\n```\n\nIf the entry is a file, `entry.content()` returns an async iterator that yields one or more Uint8Arrays containing the file content:\n\n```javascript\nif (entry.type === 'file') {\n  for await (const chunk of entry.content()) {\n    // chunk is a Buffer\n  }\n}\n```\n\nIf the entry is a directory, `entry.content()` returns further `entry` objects:\n\n```javascript\nif (entry.type === 'directory') {\n  for await (const entry of dir.content()) {\n    console.info(entry.name)\n  }\n}\n```\n\n#### Raw entries\n\nEntries with a `raw` codec `CID` return raw entries:\n\n```javascript\n{\n  name: 'foo.txt',\n  path: 'Qmbar/foo.txt',\n  cid: CID, // see https://github.com/multiformats/js-cid\n  node: Buffer, // see https://nodejs.org/api/buffer.html\n  content: function, // returns an async iterator\n}\n```\n\n`entry.content()` returns an async iterator that yields a buffer containing the node content:\n\n```javascript\nfor await (const chunk of entry.content()) {\n  // chunk is a Buffer\n}\n```\n\nUnless you an options object containing `offset` and `length` keys as an argument to `entry.content()`, `chunk` will be equal to `entry.node`.\n\n#### CBOR entries\n\nEntries with a `dag-cbor` codec `CID` return JavaScript object entries:\n\n```javascript\n{\n  name: 'foo.txt',\n  path: 'Qmbar/foo.txt',\n  cid: CID, // see https://github.com/multiformats/js-cid\n  node: Uint8Array,\n  content: function // returns an async iterator that yields a single object - see https://github.com/ipld/js-ipld-dag-cbor\n}\n```\n\nThere is no `content` function for a `CBOR` node.\n\n#### `entry.content({ offset, length })`\n\nWhen `entry` is a file or a `raw` node, `offset` and/or `length` arguments can be passed to `entry.content()` to return slices of data:\n\n```javascript\nconst length = 5\nconst data = new Uint8Array(length)\nlet offset = 0\n\nfor await (const chunk of entry.content({\n  offset: 0,\n  length\n})) {\n  data.set(chunk, offset)\n  offset += chunk.length\n}\n\n// `data` contains the first 5 bytes of the file\nreturn data\n```\n\nIf `entry` is a directory, passing `offset` and/or `length` to `entry.content()` will limit the number of files returned from the directory.\n\n```javascript\nconst entries = []\n\nfor await (const entry of dir.content({\n  offset: 0,\n  length: 5\n})) {\n  entries.push(entry)\n}\n\n// `entries` contains the first 5 files/directories in the directory\n```\n\n### `walkPath(cid, ipld)`\n\n`walkPath` will return an async iterator that yields entries for all segments in a path:\n\n```javascript\nconst { walkPath } = require('ipfs-unixfs-exporter')\n\nconst entries = []\n\nfor await (const entry of walkPath('Qmfoo/foo/bar/baz.txt', ipld)) {\n  entries.push(entry)\n}\n\n// entries contains 4x `entry` objects\n```\n\n### `recursive(cid, ipld)`\n\n`recursive` will return an async iterator that yields all entries beneath a given CID or IPFS path, as well as the containing directory.\n\n```javascript\nconst { recursive } = require('ipfs-unixfs-exporter')\n\nconst entries = []\n\nfor await (const child of recursive('Qmfoo/foo/bar', ipld)) {\n  entries.push(entry)\n}\n\n// entries contains all children of the `Qmfoo/foo/bar` directory and it's children\n```\n\n[dag API]: https://github.com/ipfs/interface-ipfs-core/blob/master/SPEC/DAG.md\n[ipld-resolver instance]: https://github.com/ipld/js-ipld-resolver\n[UnixFS]: https://github.com/ipfs/specs/tree/master/unixfs\n[pull-stream]: https://www.npmjs.com/package/pull-stream\n\n## Contribute\n\nFeel free to join in. All welcome. Open an [issue](https://github.com/ipfs/js-ipfs-unixfs-exporter/issues)!\n\nThis repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).\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## License\n\n[MIT](LICENSE)\n","readmeFilename":"README.md"}