import * as fs from 'fs-extra'; import { MoveOptions, WriteFileOptions } from 'fs-extra'; // istanbul ignore next export function stat(path: string | Buffer): Promise { return fs.stat(path); } // istanbul ignore next export function chmod( path: string | Buffer, mode: string | number ): Promise { return fs.chmod(path, mode); } export async function readFile(fileName: string): Promise; export async function readFile( fileName: string, encoding: 'utf8' ): Promise; export function readFile( fileName: string, encoding?: string ): Promise { return fs.readFile(fileName, encoding); } // istanbul ignore next export function writeFile( fileName: string, fileContent: string ): Promise { return fs.writeFile(fileName, fileContent); } // istanbul ignore next export function outputFile( file: string, data: unknown, options?: WriteFileOptions | string ): Promise { return fs.outputFile(file, data, options ?? {}); } export function remove(dir: string): Promise { return fs.remove(dir); } // istanbul ignore next export function unlink(path: string | Buffer): Promise { return fs.unlink(path); } // istanbul ignore next export function exists(path: string): Promise { return fs.pathExists(path); } // istanbul ignore next export function pathExists(path: string): Promise { return fs.pathExists(path); } // istanbul ignore next export function move( src: string, dest: string, options?: MoveOptions ): Promise { return fs.move(src, dest, options ?? {}); }