helia
    Preparing search index...

    Class UnixFSPath

    Traverses a DAG containing UnixFS directories

    A root CID may be specified to begin traversal from, otherwise the root currently being exported will be used.

    In this example, the UnixFS path /foo/bar/baz.txt path should be resolvable beneath the root CID.

    import { createHelia } from 'helia'
    import { car, UnixFSPath } from '@helia/car'
    import { CID } from 'multiformats/cid'

    const helia = await createHelia()
    const c = car(helia)
    const root = CID.parse('QmRoot')

    for await (const buf of c.export(root, {
    traversal: new UnixFSPath('/foo/bar/baz.txt')
    })) {
    // do something with `buf`
    }

    In this example, the root CID should be resolvable at the UnixFS path beneath parentCID.

    import { createHelia } from 'helia'
    import { car, UnixFSPath } from '@helia/car'
    import { CID } from 'multiformats/cid'

    const helia = await createHelia()
    const c = car(helia)
    const root = CID.parse('QmRoot')
    const parentCID = CID.parse('QmParent')

    for await (const buf of c.export(root, {
    traversal: new UnixFSPath(parentCID, '/foo/bar/baz.txt')
    })) {
    // do something with `buf`
    }

    Implements

    Index

    Constructors

    Methods

    Constructors

    Methods