Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit f216e98

Browse files
fix: update vite example (#431)
Fixes: #449 Co-authored-by: achingbrain <[email protected]>
1 parent ac0f255 commit f216e98

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"test": "tsc --noEmit"
99
},
1010
"dependencies": {
11-
"ipfs-core": "^0.15.2",
11+
"ipfs-core": "^0.16.0",
1212
"multiformats": "^9.6.5"
1313
},
1414
"devDependencies": {

src/main.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,15 @@ async function main () {
3535
* @returns {Promise<string>}
3636
*/
3737
const readFile = async (ipfs, cid) => {
38-
const decoder = new TextDecoder()
38+
const decoder = new TextDecoder()
3939
let content = ''
40+
4041
for await (const chunk of ipfs.cat(cid)) {
41-
content += decoder.decode(chunk)
42+
content += decoder.decode(chunk, {
43+
stream: true
44+
})
4245
}
46+
4347
return content
4448
}
4549

0 commit comments

Comments
 (0)