1.1.11 • Published 4 years ago

ssh-queue v1.1.11

Weekly downloads
48
License
MIT
Repository
github
Last release
4 years ago

ssh-queue

Build Status npm License: MIT

Queues SSH commands to be executed one by one.

Created after encountering a situation where too many simultaneous connection attempts were being made to an external machine.

Wrapper for node-ssh.

Example

const sshQueue = require('ssh-queue')

// Sets params for all future connections
sshQueue.setConnectionParams({
  host: HOST,
  username: USERNAME,
  password: PASSWORD
})

// Access the currently stored connection parameters
sshQueue.getConnectionParams()

// Queues upload of localFile to remoteFile
sshQueue.exec('upload', 'localFile', 'remoteFile')

// Queues download of remoteFile to localFile
sshQueue.exec('download', 'remoteFile', 'localFile')

// Queues execution of command
sshQueue.exec('command', 'ls')
sshQueue.exec('command', 'uptime')
sshQueue.exec('command', 'mkdir src')
// and so on, for any command

// Access the current length of the queue
let queueLength = sshQueue.getQueueLength()

sshQueue maintains a list of queued interactions with the remote machine (command executions, filePuts, and fileGets), which it works through one by one. A connection is opened when the queue becomes longer than zero, this connection is then maintained until the queue is empty again, at which point it is disposed of.

Connecting and disconnecting is handled automatically, but can be manually triggered via:

sshQueue.connect()

sshQueue.disconnect()

License

This project is licensed under the terms of MIT license. See the LICENSE file for more info.

1.1.11

4 years ago

1.1.9

4 years ago

1.1.10

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago