You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
success: "Congratulations! You've completed this series of lessons!",
58
62
logDesc: 'Below is the result of calling the `get` method on the top-level directory. (Normally the results would be much more dense because of the buffered file contents included, but we intentionally created tiny text files to limit this effect.)'+
59
-
"\n\n Notice that because we created these files using `{ wrapWithDirectory: true }`, each item's `path` is defined here by the top-level directory's CID plus the item's relative path, and each file or subdirectory has a human-readable `name`. Only the top-level directory itself has a `path` value that matches its `hash` and `name`, all of which are identical CIDs.",
60
-
log: result
63
+
"\n\n Notice that because we created these files using `{ wrapWithDirectory: true }`, each item's `path` is defined here by the top-level directory's CID plus the item's relative path, and each file or subdirectory has a human-readable `name`. Only the top-level directory itself has a `path` value that matches its `cid` and `name`, all of which are identical CIDs.",
64
+
log: result.map(utils.format.ipfsObject)
61
65
}
62
66
}else{
63
67
return{fail: `Something seems to be wrong. Please click "Reset Code" and try again, taking another look at the instructions and editing only the portion of code indicated. Feeling really stuck? You can click "View Solution" to see our suggested code.`}
64
68
}
65
69
}
66
70
67
71
constcode=`/* global ipfs */
72
+
const all = require('it-all')
73
+
68
74
const run = async () => {
69
-
let result = // your code here
75
+
let result = await all() // your code here
70
76
71
77
return result
72
78
}
73
79
return run
74
80
`
75
81
76
82
constsolution=`/* global ipfs */
83
+
const all = require('it-all')
84
+
77
85
const run = async () => {
78
-
let result = await ipfs.get('QmcmnUvVV31txDfAddgAaNcNKbrtC2rC9FvkJphNWyM7gy')
86
+
let result = await all(ipfs.get('QmcmnUvVV31txDfAddgAaNcNKbrtC2rC9FvkJphNWyM7gy'))
Copy file name to clipboardExpand all lines: src/tutorials/0005-regular-files-api/08.md
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,10 +3,10 @@
3
3
type: "code"
4
4
---
5
5
6
-
Need to know more about an IPFS file or directory beyond just its contents? Whereas `cat` retrieves just the buffered content of a file, we can access addtional metadata about a file or directory by calling the `get` method like so:
6
+
Need to know more about an IPFS file or directory beyond just its contents? Whereas `cat` retrieves just the buffered content of a file, we can access additional metadata about a file or directory by calling the `get` method like so:
7
7
8
8
```javascript
9
-
awaitipfs.get(ipfsPath)
9
+
ipfs.get(ipfsPath)
10
10
```
11
11
12
12
The result is an array of objects, one per file or directory, with the following structure:
0 commit comments