diff --git a/README.md b/README.md index 71057d3830..3241cd831c 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,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) @@ -521,6 +522,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.