@henteko/kumiki
Version:
A video generation tool that creates videos from JSON configurations
53 lines • 1.26 kB
JavaScript
import { mkdirSync, existsSync } from 'node:fs';
import { homedir } from 'node:os';
import path from 'node:path';
/**
* Get the application data directory
*/
export function getAppDataDir() {
const home = homedir();
return path.join(home, '.kumiki');
}
/**
* Get the cache directory
*/
export function getCacheDir(subDir) {
const appDataDir = getAppDataDir();
const cacheDir = path.join(appDataDir, 'cache', subDir || '');
return cacheDir;
}
/**
* Get the temporary directory
*/
export function getTmpDir(subDir) {
const appDataDir = getAppDataDir();
const tmpDir = path.join(appDataDir, 'tmp', subDir || '');
return tmpDir;
}
/**
* Ensure directory exists
*/
export function ensureDir(dirPath) {
if (!existsSync(dirPath)) {
mkdirSync(dirPath, { recursive: true });
}
}
/**
* Get narration cache directory
*/
export function getNarrationCacheDir() {
return getCacheDir('narration');
}
/**
* Get generated music cache directory
*/
export function getGeneratedMusicCacheDir() {
return getCacheDir('generated-music');
}
/**
* Get generated image cache directory
*/
export function getGeneratedImageCacheDir() {
return getCacheDir('generated-images');
}
//# sourceMappingURL=app-dirs.js.map