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

Commit 6f0d978

Browse files
author
Alan Shaw
committed
docs: document API methods that take a timeout option
1 parent 238b205 commit 6f0d978

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

SPEC/OBJECT.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,8 @@ A great source of [examples][] can be found in the tests for this API.
8787

8888
`options` is a optional argument of type object, that can contain the following properties:
8989

90-
- `enc`, the encoding of multihash (base58, base64, etc), if any.
90+
- `enc` (`string`) - the encoding of multihash (base58, base64, etc), if any.
91+
- `timeout` (`number`|`string`) - Throw an error if the request does not complete within the specified milliseconds timeout. If `timeout` is a string, the value is parsed as a [human readable duration](https://www.npmjs.com/package/parse-duration). There is no timeout by default.
9192

9293
**Returns**
9394

SPEC/PIN.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ Where:
1414

1515
- `hash` is an IPFS multihash.
1616
- `options` is an object that can contain the following keys
17-
- `recursive` - Recursively pin the object linked. Type: bool. Default: `true`
17+
- `recursive` (`boolean`) - Recursively pin the object linked. Type: bool. Default: `true`
18+
- `timeout` (`number`|`string`) - Throw an error if the request does not complete within the specified milliseconds timeout. If `timeout` is a string, the value is parsed as a [human readable duration](https://www.npmjs.com/package/parse-duration). There is no timeout by default.
1819

1920
**Returns**
2021

SPEC/REFS.md

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
- `format ("<dst>")`: output edges with given format. Available tokens: `<src>`, `<dst>`, `<linkname>`
2727
- `edges (false)`: output references in edge format: `"<src> -> <dst>"`
2828
- `maxDepth (1)`: only for recursive refs, limits fetch and listing to the given depth
29+
- `timeout (number|string)`: Throw an error if the request does not complete within the specified milliseconds timeout. If `timeout` is a string, the value is parsed as a [human readable duration](https://www.npmjs.com/package/parse-duration). There is no timeout by default.
2930

3031
**Returns**
3132

0 commit comments

Comments
 (0)