# ipfs-unixfs-exporter

> JavaScript implementation of the UnixFs exporter used by IPFS

Latest version **16.2.2** (published 2026-09-11) · Apache-2.0 OR MIT license · 0 weekly downloads

## Install

```sh
npm install ipfs-unixfs-exporter
pnpm add ipfs-unixfs-exporter
yarn add ipfs-unixfs-exporter
bun add ipfs-unixfs-exporter
```

## Health

**Score 75/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 16.2.2 |
| Published | 2026-09-11 |
| First published | 2018-11-14 |
| Weekly downloads | 0 |
| License | Apache-2.0 OR MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Dependencies | 16 |
| Unpacked size | 987.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 94 |
| Maintainers | achingbrain, ipfs-npm-publisher-bot, npm-service-account-ipfs |
| Keywords | IPFS |

## Links

- npm: https://www.npmjs.com/package/ipfs-unixfs-exporter
- Repository: https://github.com/ipfs/js-ipfs-unixfs
- Homepage: https://github.com/ipfs/js-ipfs-unixfs/tree/main/packages/ipfs-unixfs-exporter#readme
- Issues: https://github.com/ipfs/js-ipfs-unixfs/issues
- npm.io page: https://npm.io/package/ipfs-unixfs-exporter

## Dependencies (16)

- [it-map](https://npm.io/package/it-map.md) ^3.1.6
- [it-last](https://npm.io/package/it-last.md) ^3.0.11
- [it-pipe](https://npm.io/package/it-pipe.md) ^3.0.1
- [p-queue](https://npm.io/package/p-queue.md) ^9.2.0
- [ipfs-unixfs](https://npm.io/package/ipfs-unixfs.md) ^13.0.0
- [it-parallel](https://npm.io/package/it-parallel.md) ^3.0.15
- [it-pushable](https://npm.io/package/it-pushable.md) ^3.2.4
- [@ipld/dag-pb](https://npm.io/package/@ipld/dag-pb.md) ^4.2.0
- [it-to-buffer](https://npm.io/package/it-to-buffer.md) ^5.0.0
- [multiformats](https://npm.io/package/multiformats.md) ^14.0.0
- [hamt-sharding](https://npm.io/package/hamt-sharding.md) ^3.0.8
- [@ipld/dag-cbor](https://npm.io/package/@ipld/dag-cbor.md) ^10.0.0
- [@ipld/dag-json](https://npm.io/package/@ipld/dag-json.md) ^11.0.0
- [progress-events](https://npm.io/package/progress-events.md) ^1.1.0
- [interface-blockstore](https://npm.io/package/interface-blockstore.md) ^7.0.1
- [@multiformats/murmur3](https://npm.io/package/@multiformats/murmur3.md) ^2.2.5

## Recent versions

- 16.2.2 (latest) — 2026-09-11
- 7.0.7-rc.7 (next) — 2022-04-12
- 16.2.1 — 2026-09-10
- 16.2.0 — 2026-09-10
- 16.1.0 — 2026-09-03
- 16.0.2 — 2026-05-18
- 16.0.1 — 2026-05-12
- 16.0.0 — 2026-05-12
- 15.0.4 — 2026-03-24
- 15.0.3 — 2026-02-06
- 15.0.2 — 2026-01-12
- 15.0.1 — 2026-01-10
- 15.0.0 — 2026-01-10
- 14.0.2 — 2025-12-10
- 14.0.1 — 2025-10-03
- … 150 more at https://npm.io/package/ipfs-unixfs-exporter/versions

## README

# ipfs-unixfs-exporter

[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-ipfs-unixfs.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-ipfs-unixfs)
[![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)

> JavaScript implementation of the UnixFs exporter used by IPFS

# About

<!--

!IMPORTANT!

Everything in this README between "# About" and "# Install" is automatically
generated and will be overwritten the next time the doc generator is run.

To make changes to this section, please update the @packageDocumentation section
of src/index.js or src/index.ts

To experiment with formatting, please run "npm run docs" from the root of this
repo and examine the changes made.

-->

The UnixFS Exporter provides a means to read DAGs from a blockstore given a
CID.

## Example

```TypeScript
// import a file and export it again
import { importer } from 'ipfs-unixfs-importer'
import { exporter } from 'ipfs-unixfs-exporter'
import { MemoryBlockstore } from 'blockstore-core/memory'

// Should contain the blocks we are trying to export
const blockstore = new MemoryBlockstore()
const files = []

for await (const file of importer([{
  path: '/foo/bar.txt',
  content: new Uint8Array([0, 1, 2, 3])
}], blockstore)) {
  files.push(file)
}

console.info(files[0].cid) // Qmbaz

const entry = await exporter(files[0].cid, blockstore)

if (entry.type !== 'file') {
  throw new Error('Unexpected entry type')
}

console.info(entry.cid) // Qmqux
console.info(entry.unixfs.fileSize()) // 4

// stream content from unixfs node
const size = entry.unixfs.fileSize()
const bytes = new Uint8Array(Number(size))
let offset = 0

for await (const buf of entry.content()) {
  bytes.set(buf, offset)
  offset += buf.byteLength
}

console.info(bytes) // 0, 1, 2, 3
```

# Install

```console
$ npm i ipfs-unixfs-exporter
```

## Browser `<script>` tag

Loading this module through a script tag will make its exports available as `IpfsUnixfsExporter` in the global namespace.

```html
<script src="https://unpkg.com/ipfs-unixfs-exporter/dist/index.min.js"></script>
```

# API Docs

- <https://ipfs.github.io/js-ipfs-unixfs/modules/ipfs-unixfs-exporter.html>

# License

Licensed under either of

- 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>)
- MIT ([LICENSE-MIT](https://github.com/ipfs/js-ipfs-unixfs/blob/main/packages/ipfs-unixfs-exporter/LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

# Contribute

Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-ipfs-unixfs/issues).

Also 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.

Please 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).

Unless 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.

[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)

---
_Source: https://npm.io/package/ipfs-unixfs-exporter · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
