util.d.ts 1.2 KB

123456789101112131415161718192021222324
  1. import { type ExecOptions } from 'node:child_process';
  2. /**
  3. * Check if file exists
  4. *
  5. * @param filePath file path
  6. * @returns does the file exist
  7. */
  8. export declare const exists: (filePath: string) => Promise<boolean>;
  9. export declare const mkdir: (dirname: string) => Promise<void>;
  10. export declare const ensureDirExist: (filePath: string, strip?: boolean) => Promise<void>;
  11. export declare const readFile: (filePath: string) => Promise<string>;
  12. export declare const writeFile: (filePath: string, data: string | Uint8Array) => Promise<void>;
  13. export declare const readDir: (source: string) => Promise<string[]>;
  14. export declare const copyDir: (source: string, dest: string) => Promise<void>;
  15. export declare const exec: (cmd: string, options?: ExecOptions) => Promise<{
  16. stdout: string;
  17. stderr: string;
  18. }>;
  19. export declare const getLocalV4Ips: () => string[];
  20. export declare const getDefaultHosts: () => string[];
  21. export declare const getHash: (filePath: string) => Promise<string>;
  22. export declare const deepMerge: (target: any, ...source: any[]) => any;
  23. export declare const prettyLog: (obj?: Record<string, any>) => string;
  24. export declare const escapeStr: (path?: string) => string;