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

Function getCacheDirectory

cli/ts/cache.ts:24–40  ·  view source on GitHub ↗

*

()

Source from the content-addressed store, hash-verified

22 *
23 */
24function getCacheDirectory () {
25 const homeDir = os.homedir ();
26 let cachePath = '';
27 if (process.platform === 'win32') {
28 cachePath = path.join (process.env.LOCALAPPDATA || path.join (homeDir, 'AppData', 'Local'), 'ccxt-cli', 'cache');
29 } else if (process.platform === 'darwin') { // macOS
30 cachePath = path.join (homeDir, 'Library', 'Caches', 'ccxt-cli');
31 } else { // Linux & Others
32 cachePath = path.join (process.env.XDG_CACHE_HOME || path.join (homeDir, '.cache'), 'ccxt-cli');
33 }
34 if (!fs.existsSync (cachePath)) {
35 fs.mkdirSync (cachePath, {
36 'recursive': true,
37 });
38 }
39 return cachePath;
40}
41
42function getCachePathForHelp () {
43 loadMainConfigFile ();

Callers 9

getCachePathForHelpFunction · 0.85
loadMainConfigFileFunction · 0.85
saveConfigFileFunction · 0.85
getExchangeSettingsFunction · 0.85
checkCacheFunction · 0.85
saveCommandFunction · 0.85
getChartsFolderFunction · 0.85
printSavedCommandFunction · 0.85
handleMarketsLoadingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…