Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

chore: update object links api with real example #548

Merged
merged 1 commit into from
Oct 30, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions SPEC/OBJECT.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,16 @@ A great source of [examples][] can be found in the tests for this API.
**Example:**

```JavaScript
const multihash = 'QmPb5f92FxKPYdT3QNBd1GKiL4tZUXUrzF4Hkpdr3Gf1gK'
const multihash = 'Qmc5XkteJdb337s7VwFBAGtiaoj2QCEzyxtNRy3iMudc3E'

const links = await ipfs.object.links(multihash)
console.log(links)
const hashes = links.map((link) => link.Hash.toString())
console.log(hashes)
// Logs:
// []
// [
// 'QmZbj5ruYneZb8FuR9wnLqJCpCXMQudhSdWhdhp5U1oPWJ',
// 'QmSo73bmN47gBxMNqbdV6rZ4KJiqaArqJ1nu5TvFhqqj1R'
// ]
```

A great source of [examples][] can be found in the tests for this API.
Expand Down