1
1
# Config API <!-- omit in toc -->
2
2
3
- - [ ` ipfs.config.get([ key,] [options]) ` ] ( #ipfsconfiggetkey-options )
3
+ - [ ` ipfs.config.get(key, [options]) ` ] ( #ipfsconfiggetkey-options )
4
4
- [ Parameters] ( #parameters )
5
5
- [ Options] ( #options )
6
6
- [ Returns] ( #returns )
7
7
- [ Example] ( #example )
8
+ - [ ` ipfs.config.getAll([options]) ` ] ( #ipfsconfiggetkey-options )
9
+ - [ Options] ( #options )
10
+ - [ Returns] ( #returns )
11
+ - [ Example] ( #example )
8
12
- [ ` ipfs.config.set(key, value, [options]) ` ] ( #ipfsconfigsetkey-value-options )
9
13
- [ Parameters] ( #parameters-1 )
10
14
- [ Options] ( #options-1 )
26
30
- [ Returns] ( #returns-4 )
27
31
- [ Example] ( #example-4 )
28
32
29
- ## ` ipfs.config.get([ key,] [options]) `
33
+ ## ` ipfs.config.get(key, [options]) `
30
34
31
35
> Returns the currently being used config. If the daemon is off, it returns the stored config.
32
36
33
37
### Parameters
34
38
35
39
| Name | Type | Description |
36
40
| ---- | ---- | ----------- |
37
- | key | ` String ` | The key of the value that should be fetched from the config file. If no key is passed, then the whole config will be returned. |
41
+ | key | ` String ` | The key of the value that should be fetched from the config file. |
38
42
39
43
### Options
40
44
@@ -60,6 +64,35 @@ console.log(config)
60
64
61
65
A great source of [ examples] [ ] can be found in the tests for this API.
62
66
67
+ ## ` ipfs.config.getAll([options]) `
68
+
69
+ > Returns the full config been used. If the daemon is off, it returns the stored config.
70
+
71
+ ### Options
72
+
73
+ An optional object which may have the following keys:
74
+
75
+ | Name | Type | Default | Description |
76
+ | ---- | ---- | ------- | ----------- |
77
+ | timeout | ` Number ` | ` undefined ` | A timeout in ms |
78
+ | signal | [ AbortSignal] [ ] | ` undefined ` | Can be used to cancel any long running requests started as a result of this call |
79
+
80
+ ### Returns
81
+
82
+ | Type | Description |
83
+ | -------- | -------- |
84
+ | ` Promise<Object> ` | An object containing the configuration of the IPFS node |
85
+
86
+ ### Example
87
+
88
+ ``` JavaScript
89
+ const config = await ipfs .config .getAll ()
90
+ console .log (config)
91
+ ```
92
+
93
+ A great source of [ examples] [ ] can be found in the tests for this API.
94
+
95
+
63
96
## ` ipfs.config.set(key, value, [options]) `
64
97
65
98
> Adds or replaces a config value.
0 commit comments