file

aeq. file

Source:

[file description]

Members

(static) pathSeparatorSymbol :string

Source:

The value of the OS's file system path separator symbol; \ or /

Type:
  • string

Methods

(static) ensureFolderExists(folderPath) → {Folder}

Source:

Returns a folder, creating if it doesn't exist

Parameters:
Name Type Description
folderPath File | string

Folder path to get or create

Returns:

Target folder

Type
Folder

(static) getExtension(filePath) → {string}

Source:

Returns the extension of target file

Parameters:
Name Type Description
filePath File | string

String path to a file, or file object

Returns:

Extension of target file

Type
string

(static) getFile(filePath) → {File|null}

Source:

Gets target file by path or file object, or null if doesn't exist

Parameters:
Name Type Description
filePath File | string

String path to a file, or file object

Returns:

Target file, or null if doesn't exist

Type
File | null

(static) getFiles(folderPath, filteropt) → {aeq.arrayEx|null}

Source:

Gets all files in target path that matches filter (or, all files if no filter)

Parameters:
Name Type Attributes Default Description
folderPath File | string

Folder or path to get

filter string | function <optional>
""

Filter string or function

Returns:

Array of filtered files, or null if none

Type
aeq.arrayEx | null

(static) getFolder(folderPath) → {Folder|null}

Source:

Returns a folder, or null if it doesn't exist

Parameters:
Name Type Description
folderPath File | string

Folder path to get

Returns:

Target folder, or null if it doesn't exist

Type
Folder | null

(static) joinPath() → {string}

Source:

Joins path components into an OS-formatted file path string

Returns:

File path string joined with OS's path separator

Type
string

(static) normalizePath(path) → {string}

Source:

[description]

Parameters:
Name Type Description
path string

Raw joined file path

Returns:

Normalized path

Type
string

(static) normalizePathArray(parts, allowAboveRoot) → {Array.<string>}

Source:

[description]

Parameters:
Name Type Description
parts Array.<string>

Array of path components

allowAboveRoot boolean

[description]

Returns:

[description]

Type
Array.<string>

(static) pathIsAbsolute(path) → {boolean}

Source:

Checks whether the path starts with the OS separator symbol

Parameters:
Name Type Description
path string

File path

Returns:

True if first character equals path separator symbol

Type
boolean

(static) stripExtension(filePath) → {string}

Source:

Returns the filename of target file without extension

Parameters:
Name Type Description
filePath File | string

String path to a file, or file object

Returns:

Filename without extension

Type
string