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) getFilesRecursive(folder, filteropt) → {Array.<File>}

Source:

Recursively scan folder for all files matching filter

Parameters:
Name Type Attributes Default Description
folder Folder | String

Folder or path to get files from

filter string | function <optional>
""

Filter string or function

Returns:

Array of found files

Type
Array.<File>

(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(…paths) → {string}

Source:

Joins path components into an OS-formatted file path string

Parameters:
Name Type Attributes Description
paths String | File | Folder <repeatable>

The path elements to join.

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) selectFiles(extensionList, multiSelectopt) → {Array.<file>|null}

Source:

Prompts user to select files

Example
var myFiles = selectFiles(["jsx", "theme", "someOtherExtension"], true);
Parameters:
Name Type Attributes Default Description
extensionList Array.<string>

Array of file extensions to accept

multiSelect boolean <optional>
false

true to allow multiple files

Returns:

ArrayEx of selected file(s), or null if canceled

Type
Array.<file> | null

(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