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> |
|
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) isImage(arg0_file_path) → {boolean}
Checks whether the file extension is an image.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_file_path |
string
|
Returns:
- Type:
-
boolean
(static) isVideo(arg0_file_path) → {boolean}
Checks whether the file extension is a video.
- Source:
Parameters:
| Name | Type | Description |
|---|---|---|
arg0_file_path |
string
|
Returns:
- Type:
-
boolean
(static) loadCSVAsArray(arg0_file_path, arg1_optionsopt) → {Array.<Object>}
Loads a CSV file as an array of objects.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_file_path |
string
|
||||||||||||
arg1_options |
Object
|
<optional> |
|
(static) loadCSVAsJSON(arg0_file_path, arg1_optionsopt) → {Object}
Loads a CSV file as JSON.
- Source:
Parameters:
| Name | Type | Attributes | Description | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_file_path |
string
|
|||||||||||||||||
arg1_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Object
(static) loadJSON(arg0_file_path, arg1_optionsopt) → {Object}
Resolves and parses a JSON file if given a file path, or passes an already parsed object through.
- Source:
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
arg0_file_path |
string
|
Object
|
||
arg1_options |
Object
|
<optional> |
Returns:
- Type:
-
Object
(static) parseCSVLine(arg0_line, arg1_optionsopt) → {Array.<string>}
Parses a single line of CSV.
- Source:
Parameters:
| Name | Type | Attributes | Description | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
arg0_line |
string
|
||||||||||||
arg1_options |
Object
|
<optional> |
|
Returns:
- Type:
-
Array.<string>
(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>