@gibme/ssh
    Preparing search index...

    Class default

    Hierarchy

    • EventEmitter
      • default
    Index

    Constructors

    Accessors

    Methods

    Constructors

    • Creates a new instance of the class

      Parameters

      • config: ConnectConfig

      Returns default

    Accessors

    • get connected(): boolean

      Returns if the client is connected

      Returns boolean

    Methods

    • Connects to the remote system

      Returns Promise<void>

    • Destroy the underlying SSH connection

      Returns Promise<void>

    • Disconnects the underlying SSH connection

      Returns Promise<void>

    • Executes the command on the remote host and returns the result as a Buffer

      Parameters

      • command: string

      Returns Promise<Buffer<ArrayBufferLike>>

    • Adds the listener function to the end of the listeners array for the event named eventName. No checks are made to see if the listener has already been added. Multiple calls passing the same combination of eventName and listener will result in the listener being added, and called, multiple times.

      server.on('connection', (stream) => {
      console.log('someone connected!');
      });

      Returns a reference to the EventEmitter, so that calls can be chained.

      By default, event listeners are invoked in the order they are added. The emitter.prependListener() method can be used as an alternative to add the event listener to the beginning of the listeners array.

      import { EventEmitter } from 'node:events';
      const myEE = new EventEmitter();
      myEE.on('foo', () => console.log('a'));
      myEE.prependListener('foo', () => console.log('b'));
      myEE.emit('foo');
      // Prints:
      // b
      // a

      Parameters

      • event: "ready"
      • listener: () => void

        The callback function

      Returns this

      v0.1.101

    • Parameters

      • event: "close"
      • listener: () => void

      Returns this

    • Parameters

      • event: "end"
      • listener: () => void

      Returns this

    • Parameters

      • event: "timeout"
      • listener: () => void

      Returns this

    • Parameters

      • event: "error"
      • listener: (error: Error) => void

      Returns this

    • Parameters

      • event: "banner"
      • listener: (banner: string) => void

      Returns this

    • Parameters

      • event: "greeting"
      • listener: (greeting: string) => void

      Returns this

    • Parameters

      • event: "stream"
      • listener: (reader: Buffer) => void

      Returns this

    • Parameters

      • event: "stream_cancelled"
      • listener: () => void

      Returns this

    • Parameters

      • event: "stream_complete"
      • listener: () => void

      Returns this

    • Runs a command that initiates a 'stream' of data coming back from the remote device. The data is separated by the specified 'separator' and emitted as a Buffer via the stream event

      Parameters

      • command: string
      • options: Partial<Options> = {}

      Returns Promise<StreamController>