@clipwhisperer/common
Version:
ClipWhisperer Common - Shared library providing core utilities, database schemas, authentication, bucket management, and common functionality across all ClipWhisperer microservices
35 lines (34 loc) • 1.05 kB
TypeScript
/**
* File System Utilities
* Centralized file system operations used across services
*/
/**
* Ensure a directory exists, create it if it doesn't
*/
export declare function ensureDirectoryExists(directory: string): boolean;
/**
* Check if a directory exists and create it if it doesn't
* @param directory - The path to the directory to check
* @returns {boolean} True if the directory existed, false if it was created
*/
export declare function checkDirectoryExists(directory: string): boolean;
/**
* Get file size in bytes
*/
export declare function getFileSize(filePath: string): number;
/**
* Check if file exists
*/
export declare function fileExists(filePath: string): boolean;
/**
* Delete file if it exists
*/
export declare function deleteFileIfExists(filePath: string): boolean;
/**
* Create file path within project directory
*/
export declare function createProjectPath(...segments: string[]): string;
/**
* Sanitize filename for safe file system usage
*/
export declare function sanitizeFilename(filename: string): string;