From 3b3fc6794d1f3434ac89d061a5c7508fb4d3ed52 Mon Sep 17 00:00:00 2001 From: Arnaud Date: Fri, 13 Sep 2024 19:25:02 +0200 Subject: [PATCH] Add documentation for spr --- README.md | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1538afa..c0b3e6f 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 @@ -214,7 +214,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 @@ -261,13 +261,13 @@ const upload = await data.upload(file, (loaded: number, total: number) => { await upload.result(); ``` -### Node +### Debug 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.node(); +const data = await codex.debug; ``` #### setLogLevel @@ -294,3 +294,24 @@ Example: ```js const info = await debug.info(); ``` + +### Node + +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; +``` + +#### spr + +Get Node's SPR + +- returns Promise + +Example: + +```js +const spr = await node.spr(); +```