express-hale
Version:
🚀 Interactive Express.js scaffold CLI with comprehensive error handling, TypeScript/JavaScript, database integrations, Git Flow, and development tools
34 lines • 877 B
TypeScript
/**
* 文件操作工具函数
*/
export declare class FileUtils {
/**
* 确保目录存在,如果不存在则创建
*/
static ensureDir(dirPath: string): Promise<void>;
/**
* 安全地写入文件,确保目录存在
*/
static writeFile(filePath: string, content: string): Promise<void>;
/**
* 检查文件是否存在
*/
static exists(filePath: string): Promise<boolean>;
/**
* 复制文件
*/
static copyFile(src: string, dest: string): Promise<void>;
/**
* 删除文件或目录
*/
static remove(filePath: string): Promise<void>;
/**
* 读取JSON文件
*/
static readJson<T = any>(filePath: string): Promise<T>;
/**
* 写入JSON文件
*/
static writeJson(filePath: string, data: any): Promise<void>;
}
//# sourceMappingURL=file-utils.d.ts.map