extensions/snapshot/FileSystem

The FileSystem helper used by the FileSystem extension.

Methods

(static) createDirectory(dir) → {boolean}

Creates a directory.
Source:
Parameters:
Name Type Description
dir string directory path
Returns:
Type:
boolean

(static) getFileContent(file, encodingopt) → {string}

Loads file content.
Source:
Parameters:
Name Type Attributes Default Description
file string File path
encoding string <optional>
'utf8' Content encoding
Returns:
Type:
string
File content

(static) getFileInfo(file) → {fs.Stat|null}

Gets info about file/directory.
Source:
Parameters:
Name Type Description
file string File path
Returns:
Type:
fs.Stat | null
File/directory info or null if file/directory does not exist

(static) remove(fileOrDirectory) → {boolean}

Removes a file or directory.
Source:
Parameters:
Name Type Description
fileOrDirectory string File or directory path
Returns:
Type:
boolean

(static) writeFileContent(file, content, optionsopt)

Source:
Parameters:
Name Type Attributes Description
file string File path
content string Content to write in the file
options object <optional>
Options
Name Type Attributes Default Description
createDir boolean <optional>
true Create path dir if it doesn't exists