Class: RemoteFs
Filesystem operations on the remote host. Only available when the connection uses SFTP, because the SCP protocol has no way to list, stat, rename or delete.
Methods
exists()
exists(path): Promise<false | EntryType>;Returns the entry type, or false when nothing exists at path. Symlinks are followed, so 'symlink' means a link whose target is missing. Other errors throw.
Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<false | EntryType>
list()
list(path): Promise<RemoteEntry[]>;Lists a directory, without . and .., sorted by name.
Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<RemoteEntry[]>
lstat()
lstat(path): Promise<RemoteStats>;Stats path without following a final symlink.
Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<RemoteStats>
mkdir()
mkdir(path, options?): Promise<void>;Creates a directory. With recursive, creates missing parents too, like mkdir -p.
Parameters
| Parameter | Type |
|---|---|
path | string |
options | MkdirOptions |
Returns
Promise<void>
realpath()
realpath(path): Promise<string>;Resolves path to an absolute path on the server, for example . to the home directory.
Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<string>
rename()
rename(from, to): Promise<void>;Moves or renames from to to.
Parameters
| Parameter | Type |
|---|---|
from | string |
to | string |
Returns
Promise<void>
rm()
rm(path, options?): Promise<void>;Deletes a file or symlink, or with recursive a directory and everything in it.
Parameters
| Parameter | Type |
|---|---|
path | string |
options | RmOptions |
Returns
Promise<void>
stat()
stat(path): Promise<RemoteStats>;Stats path, following symlinks.
Parameters
| Parameter | Type |
|---|---|
path | string |
Returns
Promise<RemoteStats>