js-ipfs-unixfs
    Preparing search index...

    Entries with a raw codec CID return raw entries.

    entry.content() returns an async iterator that yields a buffer containing the node content:

    for await (const chunk of entry.content()) {
    // chunk is a Buffer
    }

    Unless you an options object containing offset and length keys as an argument to entry.content(), chunk will be equal to entry.node.

    interface RawNode {
        cid: CID;
        node: Uint8Array;
        size: bigint;
        type: "raw";
        content(
            options?: ExporterOptions,
        ): AsyncGenerator<Uint8Array<ArrayBufferLike>, void, unknown>;
    }

    Hierarchy (View Summary)

    Index

    Properties

    Methods

    Properties

    cid: CID

    The CID of the entry

    size: bigint
    type: "raw"

    A disambiguator to allow TypeScript to work out the type of the entry.

    if (entry.type === 'file') {
    // access UnixFSFile properties safely
    }

    if (entry.type === 'directory') {
    // access UnixFSDirectory properties safely
    }

    Methods