Add documentation for localDownload

This commit is contained in:
Arnaud 2024-10-25 13:28:27 +02:00
parent cf7e425863
commit c10f15ae61
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663

View File

@ -309,6 +309,21 @@ const cid = "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N";
const result = await data.networkDownloadStream(cid);
```
#### localDownload
Download a file from the local node in a streaming manner.
If the file is not available locally, a 404 is returned.
- cid (string, required)
- returns Response
Example:
```js
const cid = "QmYyQSo1c1Ym7orWxLYvCrM2EmxFTANf8wXmmE7DWjhx5N";
const result = await data.localDownload(cid);
```
### Debug
The following API assume that you have already a node module loaded, example: