From c10f15ae613a61dd4349927e582fefad3a917def Mon Sep 17 00:00:00 2001 From: Arnaud Date: Fri, 25 Oct 2024 13:28:27 +0200 Subject: [PATCH] Add documentation for localDownload --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 4c54812..61b308e 100644 --- a/README.md +++ b/README.md @@ -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: