The CID of the entry
How far down the DAG the entry is
The name of the entry
The path of the entry within the DAG in which it was encountered
The size of the entry
A disambiguator to allow TypeScript to work out the type of the entry.
Optionaloptions: ExporterOptions | BasicExporterOptionsWhen entry is a file or a raw node, offset and/or length arguments can be passed to entry.content() to return slices of data:
const length = 5
const data = new Uint8Array(length)
let offset = 0
for await (const chunk of entry.content({
offset: 0,
length
})) {
data.set(chunk, offset)
offset += chunk.length
}
// `data` contains the first 5 bytes of the file
return data
If entry is a directory, passing offset and/or length to entry.content() will limit the number of files returned from the directory.
const entries = []
for await (const entry of dir.content({
offset: 0,
length: 5
})) {
entries.push(entry)
}
// `entries` contains the first 5 files/directories in the directory
If the entry is a directory,
entry.content()returns furtherentryobjects: