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

Commit 7a98755

Browse files
author
Alan Shaw
committed
docs: add documentation for ready promise
License: MIT Signed-off-by: Alan Shaw <[email protected]>
1 parent 4831a55 commit 7a98755

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ We've come a long way, but this project is still in Alpha, lots of development i
5757
- [API Docs](#api)
5858
- [Constructor](#ipfs-constructor)
5959
- [Events](#events)
60+
- [ready](#nodeready)
6061
- [start](#nodestart)
6162
- [stop](#nodestop)
6263
- [Core API](#core-api)
@@ -521,6 +522,16 @@ node.on('error', errorObject => console.error(errorObject))
521522
522523
- `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).
523524
525+
#### `node.ready`
526+
527+
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.
528+
529+
```js
530+
const node = new IPFS()
531+
await node.ready
532+
// Ready to use!
533+
```
534+
524535
#### `node.start()`
525536
526537
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)