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

Commit d6ac355

Browse files
Mr0grogdaviddias
authored andcommitted
docs: document object form of init constructor option (#1323)
License: MIT Signed-off-by: Rob Brackett <[email protected]>
1 parent 7a817cf commit d6ac355

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,15 @@ Creates and returns an instance of an IPFS node. Use the `options` argument to s
211211

212212
If you have already initialized a repo before creating your IPFS node (e.g. you are loading a repo that was saved to disk from a previous run of your program), you must make sure to set this to `false`. Note that *initializing* a repo is different from creating an instance of [`ipfs.Repo`](https://github.com/ipfs/js-ipfs-repo). The IPFS constructor sets many special properties when initializing a repo, so you should usually not try and call `repoInstance.init()` yourself.
213213

214-
Instead of a boolean, you may provide an object with custom initialization options.
214+
Instead of a boolean, you may provide an object with custom initialization options. All properties are optional:
215+
216+
- `init.emptyRepo` (boolean) Whether to remove built-in assets, like the instructional tour and empty mutable file system, from the repo. (Default: `false`)
217+
- `init.bits` (number) Number of bits to use in the generated key pair. (Default: `2048`)
218+
- `init.pass` (string) A passphrase to encrypt keys. You should generally use the top-level `pass` option instead of the `init.pass` option (this one will take its value from the top-level option if not set).
215219

216220
- `start` (boolean): If `false`, do not automatically start the IPFS node. Instead, you’ll need to manually call `node.start()` yourself. (Default: `true`)
217221

218-
- `pass` (string): A passphrase to encrypt your keys.
222+
- `pass` (string): A passphrase to encrypt/decrypt your keys.
219223

220224
- `EXPERIMENTAL` (object): Enable and configure experimental features.
221225
- `pubsub` (boolean): Enable libp2p pub-sub. (Default: `false`)

0 commit comments

Comments
 (0)