New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ssh-queue

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssh-queue

Queues SSH commands to be executed one by one

latest
Source
npmnpm
Version
1.1.11
Version published
Maintainers
1
Created
Source

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.

Keywords

ssh

FAQs

Package last updated on 24 Nov 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts