This repository was archived by the owner on Feb 12, 2024. It is now read-only.
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
ipfs.files.get and ipfs.files.cat do not support ipfs-path format #837
Closed
Description
let ipfsPath = 'QmcKi2ae3uGb1kBg1yBpsuwoVqfmcByNdMiZ2pukxyLWD8/index.html'
ipfs.files.cat(ipfsPath, (err, stream) => {
console.log('throws exception before it gets to this')
})
The go-ipfs daemon takes care of this for me (ipfs cat QmcKi2ae3uGb1kBg1yBpsuwoVqfmcByNdMiZ2pukxyLWD8/index.html
), so I was surprised to run into this.
The way it seems to be implemented in js-ipfs is that ipfs.files.get
can iterate over every "file" and provides an object with a path and stream, but that could have performance implications if we were trying to grab individual objects from larger trees. I don't always want to go through the whole thing.