Skip to content

Commit a42a6bb

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

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

+1-1
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.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ export default async function main() {
2828
const readFile = async (ipfs: IPFS, cid: CID): Promise<string> => {
2929
const decoder = new TextDecoder()
3030
let content = ''
31+
3132
for await (const chunk of ipfs.cat(cid)) {
32-
content += decoder.decode(chunk)
33+
content += decoder.decode(chunk, {
34+
stream: true
35+
})
3336
}
3437

3538
return content

0 commit comments

Comments
 (0)