The FileSystem helper used by the FileSystem extension.
Methods
(static) createDirectory(cwd, directory) → {Promise.<boolean>}
Creates a directory.
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.
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.
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.
Parameters:
Name | Type | Description |
---|---|---|
cwd |
string
|
Current Working Directory |
fileOrDirectory |
string
|
File or directory name |
Returns:
- Type:
-
Promise.<boolean>