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

Commit

Permalink
docs: add documentation for ready promise
Browse files Browse the repository at this point in the history
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
Alan Shaw authored and alanshaw committed Jul 17, 2019
1 parent 4e56290 commit 0dbf133
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ We've come a long way, but this project is still in Alpha, lots of development i
- [API Docs](#api)
- [Constructor](#ipfs-constructor)
- [Events](#events)
- [ready](#nodeready)
- [start](#nodestart)
- [stop](#nodestop)
- [Core API](#core-api)
Expand Down Expand Up @@ -541,6 +542,16 @@ node.on('error', errorObject => console.error(errorObject))
- `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).
#### `node.ready`
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.
```js
const node = new IPFS()
await node.ready
// Ready to use!
```
#### `node.start()`
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.
Expand Down

0 comments on commit 0dbf133

Please sign in to comment.