extensions/FileSystem/FileSystem

The FileSystem helper used by the FileSystem extension.

Methods

(static) createDirectory(cwd, directory) → {Promise.<boolean>}

Creates a directory.
Source:
Parameters:
Name Type Description
cwd string Current Working Directory
directory string Directory name
Returns:
Type:
Promise.<boolean>

(static) getFileContent(cwd, file, encodingopt) → {Promise.<string>}

Loads file content.
Source:
Parameters:
Name Type Attributes Default Description
cwd string Current Working Directory
file string File name
encoding string <optional>
'utf8' Content encoding
Returns:
Type:
Promise.<string>
File content

(static) getFileInfo(cwd, file) → {Promise.<(fs.Stat|null)>}

Gets info about file/directory.
Source:
Parameters:
Name Type Description
cwd string Current Working Directory
file string File name
Returns:
Type:
Promise.<(fs.Stat|null)>
File/directory info or null if file/directory does not exist

(static) remove(cwd, fileOrDirectory) → {Promise.<boolean>}

Removes a file or directory.
Source:
Parameters:
Name Type Description
cwd string Current Working Directory
fileOrDirectory string File or directory name
Returns:
Type:
Promise.<boolean>