
Security News
Deno 2.4 Brings Back deno bundle, Improves Dependency Management and Observability
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
ssh2-executor
Advanced tools
Execute one or more commands on the target machine by ssh2 and reduce results.
Execute one or more commands on the target machine by ssh2 and reduce results.
Install ssh2-executor using npm:
$ npm install ssh2-executor --save-dev
const Executor = require('ssh2-executor');
Executor.run({object} argv, {Array} commands, {function} reduce);
argv
{object} SSH2 connection options:
host
{string} Default: localhostport
{number} Default: 22username
{string} Default: administratorpassword
{string} Default: nullcommands
{Array} Commands to executereduce
{function} Reduce function takes next parameters:
resutls
{Array} Result outputs according to commandstiming
{object} total beg, end msExecute whoami
and hostname
commands on the target machine, compare with the expected values and out boolean answer:
'use strict';
const argv = require('optimist').argv;
const Executor = require('ssh2-executor');
Executor.run(argv, [
'whoami',
'hostname'
], (results, t) => {
console.log(/^administrator\s?/.test(results[0]) && /^SuperMachine\s?/.test(results[1]));
console.log(`Execution Time ${t.end - t.beg} ms`);
});
Output:
true
Execution Time 923 ms
FAQs
Execute one or more commands on the target machine by ssh2 and reduce results.
The npm package ssh2-executor receives a total of 0 weekly downloads. As such, ssh2-executor popularity was classified as not popular.
We found that ssh2-executor demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.