1 | # @truffle/config
|
2 | Utility for interacting with truffle-config.js files
|
3 |
|
4 | ### Usage
|
5 | ```javascript
|
6 | const TruffleConfig = require("@truffle/config");
|
7 | ```
|
8 |
|
9 | #### Instantiate default TruffleConfig object
|
10 | ```javascript
|
11 | const newConfig = TruffleConfig.default();
|
12 | ```
|
13 |
|
14 | #### Instantiate custom TruffleConfig object
|
15 | ```javascript
|
16 | const customConfig = new TruffleConfig("/truffleDirPath", "/currentWorkingDirPath", networkObj);
|
17 | ```
|
18 |
|
19 | #### Config.detect()
|
20 | ```javascript
|
21 | // find config file & return new TruffleConfig object with config file settings (cwd)
|
22 | const truffleConfig = TruffleConfig.detect();
|
23 |
|
24 | // find config file & return new TruffleConfig object from custom working dir
|
25 | const truffleConfig = TruffleConfig.detect({ workingDirectory: "./some/Path" });
|
26 |
|
27 | // find & return new TruffleConfig object from custom named config
|
28 | const customTruffleConfig = TruffleConfig.detect({}, "./customConfig.js");
|
29 | ```
|
30 |
|
\ | No newline at end of file |