Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit 0dbf133

Browse files
Alan Shawalanshaw
Alan Shaw
authored andcommitted
docs: add documentation for ready promise
License: MIT Signed-off-by: Alan Shaw <[email protected]>
1 parent 4e56290 commit 0dbf133

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Diff for: README.md

+11
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ We've come a long way, but this project is still in Alpha, lots of development i
5858
- [API Docs](#api)
5959
- [Constructor](#ipfs-constructor)
6060
- [Events](#events)
61+
- [ready](#nodeready)
6162
- [start](#nodestart)
6263
- [stop](#nodestop)
6364
- [Core API](#core-api)
@@ -541,6 +542,16 @@ node.on('error', errorObject => console.error(errorObject))
541542
542543
- `stop` is emitted when a node has closed all connections and released access to its repo. This is usually the result of calling [`node.stop()`](#nodestop).
543544
545+
#### `node.ready`
546+
547+
A promise that resolves when the node is ready to use. Should be used when constructing an IPFS node using `new`. You don't need to use this if you're using [`await IPFS.create`](#ipfs-constructor). e.g.
548+
549+
```js
550+
const node = new IPFS()
551+
await node.ready
552+
// Ready to use!
553+
```
554+
544555
#### `node.start()`
545556
546557
Start listening for connections with other IPFS nodes on the network. In most cases, you do not need to call this method — `IPFS.create()` will automatically do it for you.

0 commit comments

Comments
 (0)