API reference
Preparing search index…

Asynchronous SFTP client based on ssh2; file operations run in call order.

Source & inheritance
Member directory21

Constructors

Properties

Methods

Constructors

Properties

AttributesResult: typeof SftpAttributesResult = SftpAttributesResult

Attributes result type.

Source & inheritance
HostKeyType: typeof SftpHostKeyType = SftpHostKeyType

Server host public key type.

Source & inheritance
ListingResult: typeof SftpListingResult = SftpListingResult

Directory listing result type.

Source & inheritance
PathResult: typeof SftpPathResult = SftpPathResult

Path result type.

Source & inheritance
Result: typeof SftpResult = SftpResult

Basic result type.

Source & inheritance

Methods

  • Destroy the SSH connection immediately and wake pending operations.

    Returns

    void
    Source & inheritance
  • Establish an SSH handshake on port 22 by default; then call login to authenticate. Host trust is not verified automatically; applications can verify the host fingerprint via getSessionInfo before logging in.

    Parameters

    server
    port
    number = 22
    timeout
    SftpTimeout = Time.Zero

    Returns

    Promise<SftpResult>
    Source & inheritance
  • Create a remote directory with default Unix permissions of 0o755.

    Parameters

    path
    string
    permissions
    number = 0o755
    timeout
    SftpTimeout = Time.Zero

    Returns

    Promise<SftpResult>
    Source & inheritance
  • Authenticate asynchronously with a username and password, then open an SFTP channel.

    Parameters

    name
    string
    password
    string
    timeoutOptional

    Returns

    Promise<SftpResult>
    Source & inheritance
  • Authenticate asynchronously with matching public/private keys and an optional private-key passphrase; key arguments are contents, not paths.

    Parameters

    name
    string
    publicKey
    string | Uint8Array
    privateKey
    string | Uint8Array
    passphraseOptional
    string
    timeoutOptional

    Returns

    Promise<SftpResult>
    Source & inheritance
  • Rename a remote path; overwrite true requires server support for the OpenSSH overwrite-rename extension.

    Parameters

    oldPath
    string
    newPath
    string
    overwrite
    boolean = false
    timeout
    SftpTimeout = Time.Zero

    Returns

    Promise<SftpResult>
    Source & inheritance
  • Upload a file using callback-provided chunks, awaiting each chunk's write.

    Parameters

    path
    string

    Remote file path.

    callback

    Callback that fills the buffer and sets size.

    permissions
    number = 0o644

    Permissions for new files; defaults to 0o644.

    truncate
    boolean = true

    Whether to clear an existing file; defaults to true.

    append
    boolean = false

    Whether to request append writes; defaults to false.

    offset
    bigint = 0n

    Starting byte offset; defaults to 0n, maximum 2^53-1.

    timeout
    SftpTimeout = Time.Zero

    No-progress timeout configuration; no timeout by default.

    Returns

    Promise<SftpResult>
    Source & inheritance

Icons made by Lorc, Delapouite & Skoll · game-icons.net · CC BY 3.0