The CID of the entry
The name the entry is stored under within the directory
The path of the entry within the containing directory structure
The size of the entry
A disambiguator to allow TypeScript to work out the type of the entry.
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
Optionaloptions: ExportContentOptions
If the entry is a file,
entry.content()returns an async iterator that yields one or more Uint8Arrays containing the file content: