File

File

The namespace for all UF/File utility functions, typically for static methods.

Source:

Methods

(static) containsPath(arg0_file_path, arg1_folder_path) → {boolean}

Whether a file is inside a folder path.

Source:
Parameters:
Name Type Description
arg0_file_path string
arg1_folder_path string
Returns:
Type:
boolean

(static) convertImageToBase64(arg0_file_path) → {string}

Converts an image, preferably .png, to a Base64 string for inline embedding.

Source:
Parameters:
Name Type Description
arg0_file_path string
Returns:
Type:
string

(static) getAllDrives() → {Array.<string>}

Returns all drives in the current operating system.

Source:
Returns:
Type:
Array.<string>

(static) getAllFiles(arg0_folder_path, arg1_optionsopt) → {Array.<string>}

Returns all files in a current folder path as full file paths.

Source:
Parameters:
Name Type Attributes Description
arg0_folder_path string
arg1_options Object <optional>
Name Type Attributes Description
excluded_paths Array.<string> <optional>
Returns:
Type:
Array.<string>

(static) getAllFilesSync(arg0_folder_path) → {Array.<string>}

Returns all files in a current folder synchronously.

Source:
Parameters:
Name Type Description
arg0_folder_path string
Returns:
Type:
Array.<string>

(static) getLastModified(arg0_file_path) → {Promise.<{last_modified: Date, seconds: number}>}

Returns the time at which a file was last modified.

Source:
Parameters:
Name Type Description
arg0_file_path string
Returns:
Type:
Promise.<{last_modified: Date, seconds: number}>

(static) isDrive(arg0_file_path) → {boolean}

Whether the selected file path is a valid drive.

Source:
Parameters:
Name Type Description
arg0_file_path string
Returns:
Type:
boolean

(static) isFile(arg0_file_path) → {boolean}

Returns whether the given file path is a file.

Source:
Parameters:
Name Type Description
arg0_file_path string
Returns:
Type:
boolean

(static) isFolder(arg0_file_path) → {boolean}

Returns whether the given file path is a folder.

Source:
Parameters:
Name Type Description
arg0_file_path string
Returns:
Type:
boolean

(static) readLinesBackwards(arg0_file_path) → {AsyncGenerator.<string>}

Reads lines in a file backwards and returns results line-by-line in 64KB chunks.

Source:
Parameters:
Name Type Description
arg0_file_path string
Returns:
Type:
AsyncGenerator.<string>