Entries with a raw codec CID return raw entries.
raw
entry.content() returns an async iterator that yields a buffer containing the node content:
entry.content()
for await (const chunk of entry.content()) { // chunk is a Buffer} Copy
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.
offset
length
chunk
entry.node
The CID of the entry
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} Copy
if (entry.type === 'file') { // access UnixFSFile properties safely}if (entry.type === 'directory') { // access UnixFSDirectory properties safely}
Optional
Entries with a
rawcodec CID return raw entries.entry.content()returns an async iterator that yields a buffer containing the node content:Unless you an options object containing
offsetandlengthkeys as an argument toentry.content(),chunkwill be equal toentry.node.