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

Commit 750dfea

Browse files
committed
feat(name): add name.resolve spec
1 parent 781ac2f commit 750dfea

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

API/name/README.md

+23-6
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ name API
2121
}
2222
```
2323

24-
`callback` must follow `function (err, name) {}` signature, where `err` is an error if the operation was not successful. `name` is an object that contains the IPNS hash and the IPFS hash publishes, such as:
24+
`callback` must follow `function (err, name) {}` signature, where `err` is an error if the operation was not successful. `name` is an object that contains the IPNS hash and the IPFS hash, such as:
2525

2626
```JavaScript
2727
{
@@ -44,13 +44,30 @@ Example:
4444
4545
##### `Go` **WIP**
4646

47-
##### `JavaScript` - ipfs.name.resolve(value, [options, callback])
47+
##### `JavaScript` - ipfs.name.resolve([options, callback])
4848

49-
If no `callback` is passed, a promise is returned.
49+
`options` is an object that may contain:
50+
51+
```JavaScript
52+
{
53+
recursive: // bool - Resolve until the result is not an IPNS name. Default: false.
54+
nocache: // bool - Do not use cached entries. Default: false.
55+
}
56+
```
5057

51-
-r, --recursive bool - Resolve until the result is not an IPNS name. Default: false.
52-
-n, --nocache bool - Do not use cached entries. Default: false.
58+
`callback` must follow `function (err, name) {}` signature, where `err` is an error if the operation was not successful. `name` is an object that contains the IPNS hash and the IPFS hash, such as:
5359

54-
Example:
60+
```JavaScript
61+
{
62+
name: "/ipns/QmHash.."
63+
value: "/ipfs/QmHash.."
64+
}
65+
```
66+
67+
If no `callback` is passed, a promise is returned.
5568

69+
Example:
5670

71+
```JavaScript
72+
// TODO
73+
```

0 commit comments

Comments
 (0)