UNPKG

redis-smq-common

Version:

RedisSMQ Common Library provides many components that are mainly used by RedisSMQ and RedisSMQ Monitor.

19 lines 650 B
import os from 'node:os'; import path from 'path'; const CACHE_DIR = { darwin: path.join(os.homedir(), 'Library', 'Caches'), linux: path.join(os.homedir(), '.cache'), win32: process.env.LOCALAPPDATA || path.join(os.homedir(), 'AppData', 'Local'), freebsd: path.join(os.homedir(), '.cache'), openbsd: path.join(os.homedir(), '.cache'), android: path.join(os.homedir(), '.cache'), }; export function getCacheDir() { const platform = os.platform(); const dir = CACHE_DIR[platform]; if (!dir) { throw new Error(`Unsupported platform: ${platform}`); } return dir; } //# sourceMappingURL=cache-dir.js.map