ipfs-unixfs-exporter
JavaScript implementation of the UnixFs exporter used by IPFS
Last updated 2 months ago by GitHub Actions .
Apache-2.0 OR MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install ipfs-unixfs-exporter 
SYNC missed versions from official npm registry.

ipfs-unixfs-exporter

ipfs.tech Discuss codecov CI

JavaScript implementation of the UnixFs exporter used by IPFS

About

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

Example

// 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

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

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

API Docs

License

Licensed under either of

Contribute

Contributions welcome! Please check out the issues.

Also see our contributing document 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.

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.

Current Tags

  • 16.2.3                                ...           latest (2 months ago)
  • 7.0.7-rc.7                                ...           next (5 years ago)

166 Versions

  • 16.2.3                                ...           2 months ago
  • 16.2.2                                ...           3 months ago
  • 16.2.1                                ...           3 months ago
  • 16.2.0                                ...           3 months ago
  • 16.1.0                                ...           3 months ago
  • 16.0.2                                ...           6 months ago
  • 16.0.1                                ...           7 months ago
  • 16.0.0                                ...           7 months ago
  • 15.0.4                                ...           8 months ago
  • 15.0.3                                ...           10 months ago
  • 15.0.2                                ...           a year ago
  • 15.0.1                                ...           a year ago
  • 15.0.0                                ...           a year ago
  • 14.0.2                                ...           a year ago
  • 14.0.1                                ...           a year ago
  • 14.0.0                                ...           a year ago
  • 13.7.3                                ...           a year ago
  • 13.7.2                                ...           a year ago
  • 13.7.1                                ...           a year ago
  • 13.7.0                                ...           a year ago
  • 13.6.6                                ...           a year ago
  • 13.6.5                                ...           a year ago
  • 13.6.4                                ...           a year ago
  • 13.6.3                                ...           a year ago
  • 13.6.2                                ...           2 years ago
  • 13.6.1                                ...           2 years ago
  • 13.6.0                                ...           2 years ago
  • 13.5.1                                ...           2 years ago
  • 13.5.0                                ...           3 years ago
  • 13.4.0                                ...           3 years ago
  • 13.3.1                                ...           3 years ago
  • 13.3.0                                ...           3 years ago
  • 13.2.5                                ...           3 years ago
  • 13.2.4                                ...           3 years ago
  • 13.2.3                                ...           3 years ago
  • 13.2.2                                ...           3 years ago
  • 13.2.1                                ...           3 years ago
  • 13.2.0                                ...           3 years ago
  • 13.1.7                                ...           3 years ago
  • 13.1.6                                ...           3 years ago
  • 13.1.5                                ...           4 years ago
  • 13.1.4                                ...           4 years ago
  • 13.1.3                                ...           4 years ago
  • 13.1.2                                ...           4 years ago
  • 13.1.1                                ...           4 years ago
  • 13.1.0                                ...           4 years ago
  • 13.0.6                                ...           4 years ago
  • 13.0.5                                ...           4 years ago
  • 13.0.4                                ...           4 years ago
  • 13.0.3                                ...           4 years ago
  • 13.0.2                                ...           4 years ago
  • 13.0.1                                ...           4 years ago
  • 13.0.0                                ...           4 years ago
  • 12.0.2                                ...           4 years ago
  • 12.0.1                                ...           4 years ago
  • 12.0.0                                ...           4 years ago
  • 11.0.0                                ...           4 years ago
  • 10.0.1                                ...           4 years ago
  • 10.0.0                                ...           4 years ago
  • 9.0.2                                ...           4 years ago
  • 9.0.1                                ...           4 years ago
  • 9.0.0                                ...           4 years ago
  • 8.0.6                                ...           4 years ago
  • 8.0.5                                ...           4 years ago
  • 8.0.4                                ...           4 years ago
  • 8.0.3                                ...           4 years ago
  • 8.0.2                                ...           4 years ago
  • 8.0.1                                ...           4 years ago
  • 8.0.0                                ...           4 years ago
  • 7.0.11                                ...           5 years ago
  • 7.0.10                                ...           5 years ago
  • 7.0.9                                ...           5 years ago
  • 7.0.8                                ...           5 years ago
  • 7.0.7                                ...           5 years ago
  • 7.0.7-rc.7                                ...           5 years ago
  • 7.0.7-rc.6                                ...           5 years ago
  • 7.0.7-rc.5                                ...           5 years ago
  • 7.0.6                                ...           5 years ago
  • 7.0.5-rc.3                                ...           5 years ago
  • 7.0.5                                ...           5 years ago
  • 7.0.4                                ...           5 years ago
  • 7.0.4-rc.0                                ...           5 years ago
  • 7.0.3-rc.0                                ...           5 years ago
  • 7.0.3                                ...           5 years ago
  • 7.0.2                                ...           5 years ago
  • 7.0.1                                ...           5 years ago
  • 7.0.1-rc.0                                ...           5 years ago
  • 7.0.0                                ...           5 years ago
  • 6.0.3-rc.0                                ...           5 years ago
  • 6.0.2                                ...           5 years ago
  • 6.0.2-rc.0                                ...           5 years ago
  • 6.0.1-rc.0                                ...           5 years ago
  • 6.0.1                                ...           5 years ago
  • 6.0.0                                ...           5 years ago
  • 5.0.4-rc.0                                ...           5 years ago
  • 5.0.3                                ...           6 years ago
  • 5.0.3-rc.0                                ...           6 years ago
  • 5.0.2                                ...           6 years ago
  • 5.0.2-rc.2                                ...           6 years ago
  • 5.0.2-rc.1                                ...           6 years ago
  • 5.0.2-rc.0                                ...           6 years ago
  • 5.0.1-rc.0                                ...           6 years ago
  • 5.0.1                                ...           6 years ago
  • 5.0.0                                ...           6 years ago
  • 4.0.1                                ...           6 years ago
  • 4.0.1-rc.1                                ...           6 years ago
  • 4.0.1-rc.0                                ...           6 years ago
  • 4.0.0                                ...           6 years ago
  • 3.0.8-rc.1                                ...           6 years ago
  • 3.0.7                                ...           6 years ago
  • 3.0.7-rc.3                                ...           6 years ago
  • 3.0.7-rc.1                                ...           6 years ago
  • 3.0.7-rc.0                                ...           6 years ago
  • 3.0.6                                ...           6 years ago
  • 3.0.5                                ...           6 years ago
  • 3.0.5-rc.5                                ...           6 years ago
  • 3.0.5-rc.2                                ...           6 years ago
  • 3.0.4-rc.0                                ...           6 years ago
  • 3.0.4                                ...           6 years ago
  • 3.0.3-rc.0                                ...           6 years ago
  • 3.0.3                                ...           6 years ago
  • 3.0.2                                ...           6 years ago
  • 3.0.2-rc.0                                ...           6 years ago
  • 3.0.1                                ...           6 years ago
  • 2.0.2-rc.3                                ...           6 years ago
  • 3.0.0                                ...           6 years ago
  • 2.0.2-rc.2                                ...           6 years ago
  • 2.0.2                                ...           6 years ago
  • 2.0.2-rc.1                                ...           6 years ago
  • 2.0.1                                ...           7 years ago
  • 2.0.1-rc.0                                ...           7 years ago
  • 2.0.0                                ...           7 years ago
  • 1.1.1-rc.0                                ...           7 years ago
  • 1.1.0                                ...           7 years ago
  • 1.0.3                                ...           7 years ago
  • 1.0.3-rc.0                                ...           7 years ago
  • 1.0.2                                ...           7 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
  • 0.41.2-rc.112                                ...           7 years ago
  • 0.41.2-rc.115                                ...           7 years ago
  • 0.41.1                                ...           7 years ago
  • 0.41.0                                ...           7 years ago
  • 0.40.0                                ...           7 years ago
  • 0.39.0                                ...           7 years ago
  • 0.38.0                                ...           7 years ago
  • 0.37.7                                ...           7 years ago
  • 0.37.6                                ...           8 years ago
  • 0.37.5                                ...           8 years ago
  • 0.37.4                                ...           8 years ago
  • 0.37.3                                ...           8 years ago
  • 0.37.2                                ...           8 years ago
  • 0.37.1                                ...           8 years ago
  • 0.37.0                                ...           8 years ago
  • 0.36.1                                ...           8 years ago
  • 0.36.0                                ...           8 years ago
  • 0.35.9                                ...           8 years ago
  • 0.35.8                                ...           8 years ago
  • 0.35.7                                ...           8 years ago
  • 0.35.6                                ...           8 years ago
  • 0.35.5                                ...           8 years ago
  • 0.35.4                                ...           8 years ago
  • 0.35.2                                ...           8 years ago
  • 0.35.1                                ...           8 years ago
  • 0.35.0                                ...           8 years ago
  • 0.34.0                                ...           8 years ago
Downloads
Total 516
Today 0
This Week 22
This Month 441
Last Day 0
Last Week 176
Last Month 50
Dependencies (16)
Dev Dependencies (17)

© 2010 - cnpmjs.org x YWFE | Home | YWFE