How to find out whether an IPFS hash is a directory or file?
AdityaNambiar opened this issue · 1 comments
AdityaNambiar commented
Hello,
is there a way to programmatically figure out when a multihash is received whether it is a directory or a raw file?
I tested this by doing a ipfs ls on the multihash of a raw file and it returned nothing. So I assume thats the same case for the ipfs.ls() method from this library.
So I wonder if there is any method that this library might be providing or reflecting from the IPFS API methods to fetch some metadata that gives answer to my question asked above?
AdityaNambiar commented
ipfs.files.stat returns a Promise object containing a "type" key that does what is mentioned in the issue.