/** * Confirms if a given path is writable. * * @param {string} file * * @returns {Promise} * @category File System */ export function isWritable(file: string): Promise; /** * Attempts to create a file at the given path, creating any missing folders along the way. * If the file already exists, its modification time will be updated. * * @param {string} file * * @category File System */ export function touch(file: string): Promise; /** * Deletes the file at the given path, if it exists. * * @param {string} file * * @category File System */ export function remove(file: string): Promise; /** * Write the passed data structure to a file as JSON. * * @param {string} file * @param {Object|Array} object * @param {Object} [options] Options for fs.writeFile * @param {string} [options.encoding] File encoding for the data, defaults to utf8 * * @alias writeJSON * @category File System */ export function writeJson(file: string, object: any | any[], options?: { encoding?: string; }): Promise; /** * Reads a JSON file from disk and parses its contents. * * @param {string} file * @param {Object} [options] Options for fs.readFile * @param {Function} [options.reviver] * @param {boolean} [options.quiet] * @param {string} [options.encoding] File encoding for the data, defaults to utf8 * * @returns {Object|Array|string|number|boolean} * @alias readJSON * @category File System */ export function readJson(file: string, { reviver, quiet, ...options }?: { reviver?: Function; quiet?: boolean; encoding?: string; }): any | any[] | string | number | boolean; export const pipeline: any; export function mkdir(f: any, recursive?: boolean): any; export function exists(f: any): any; export function stat(f: any): any; export function linkStat(f: any): any; /** * Write the passed data structure to a file as JSON. * * @param {string} file * @param {Object|Array} object * @param {Object} [options] Options for fs.writeFile * @param {string} [options.encoding] File encoding for the data, defaults to utf8 * * @alias writeJSON * @category File System */ export function writeJSON(file: string, object: any | any[], options?: { encoding?: string; }): Promise; /** * Reads a JSON file from disk and parses its contents. * * @param {string} file * @param {Object} [options] Options for fs.readFile * @param {Function} [options.reviver] * @param {boolean} [options.quiet] * @param {string} [options.encoding] File encoding for the data, defaults to utf8 * * @returns {Object|Array|string|number|boolean} * @alias readJSON * @category File System */ export function readJSON(file: string, { reviver, quiet, ...options }?: { reviver?: Function; quiet?: boolean; encoding?: string; }): any | any[] | string | number | boolean;