MCPcopy Create free account
hub / github.com/ccxt/ccxt / loadMainConfigFile

Function loadMainConfigFile

cli/ts/cache.ts:47–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

45}
46
47function loadMainConfigFile () {
48 const cachePath = getCacheDirectory ();
49 const configFilePath = path.join (cachePath, 'config.json');
50 if (!fs.existsSync (configFilePath)) {
51 fs.writeFileSync (configFilePath, JSON.stringify (defaultConfig, null, 2));
52 return defaultConfig;
53 }
54
55 const configContent = JSON.parse (fs.readFileSync (configFilePath).toString ());
56 return configContent;
57}
58
59function saveConfigFile (config) {
60 const cachePath = getCacheDirectory ();

Callers 4

getCachePathForHelpFunction · 0.85
getExchangeSettingsFunction · 0.85
checkCacheFunction · 0.85
changeConfigPathFunction · 0.85

Calls 3

getCacheDirectoryFunction · 0.85
parseMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…