From 4906681a8eb378466b0b0b8038c4baba982fe935 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Pavl=C3=ADn?= Date: Tue, 25 Mar 2025 19:47:49 +0100 Subject: [PATCH] various small README and comment fixes --- README.md | 8 ++++---- src/data/data.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 05d7d1c..7ce7ddf 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ const codex = new Codex("http://localhost:3000"); To use a module, you need to use the await syntax. If the module is not loaded yet, it will be imported first and then cached in memory. ```js -const marketplace = await codex.marketplace; +const marketplace = await codex.marketplace(); ``` ### Error handling @@ -241,7 +241,7 @@ The following API assume that you have already a data module loaded, example: ```js const codex = new Codex("http://localhost:3000"); -const data = await codex.data; +const data = await codex.data(); ``` #### cids @@ -342,7 +342,7 @@ The following API assume that you have already a node module loaded, example: ```js const codex = new Codex("http://localhost:3000"); -const data = await codex.debug; +const data = await codex.debug(); ``` #### setLogLevel @@ -376,7 +376,7 @@ The following API assume that you have already a node module loaded, example: ```js const codex = new Codex("http://localhost:3000"); -const node = await codex.node; +const node = await codex.node(); ``` #### spr diff --git a/src/data/data.ts b/src/data/data.ts index a20baed..ed67120 100644 --- a/src/data/data.ts +++ b/src/data/data.ts @@ -127,8 +127,8 @@ export class CodexData { } /** - * Download a file from the network in a streaming manner. - * If the file is not available locally, it will be retrieved from other nodes in the network if able. + * Download a file from the network to the local node if it's not available locally. + * Note: Download is performed async. Call can return before download is completed. */ async networkDownload(cid: string): Promise> { const url = this.url + Api.config.prefix + `/data/${cid}/network`;