edgeport - v1.0.3
    Preparing search index...

    Function getFile

    • Connects, retrieves a single file, then quits.

      A one-shot convenience over connect that opens a session, runs FtpSession.get, and closes the connection before returning.

      Parameters

      Returns Promise<Uint8Array<ArrayBufferLike>>

      The file's raw bytes (the tail from opts.offset when set).

      If the server rejects the credentials.

      If the connection cannot be established.

      If the server speaks the protocol incorrectly.

      1.0.0

      import { getFile } from 'edgeport/ftp';

      const bytes = await getFile({ hostname: 'ftp.example.com', path: '/pub/readme.txt' });
      const text = await getFile({ hostname: 'ftp.example.com', path: '/a.txt', type: 'ascii' });