2.0.0 • Published 8 months ago

@trans.js/node-ssh-client v2.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
8 months ago

@trans.js/node-ssh-client

ssh2的重新打包

ssh2依赖一些node模块,本项目在linux x86-64系统下打包发布。

node-gyp 是一个 Node.js 模块,用于编译 Node.js C++ 插件。它提供了一个命令行工具,可以编译 C++ 代码并将其编译为 Node.js 模块。

示例

const { default: SSH } = require('@trans.js/node-ssh-client');
import SSH from '@trans.js/node-ssh-client'
import minimist from 'minimist';

const args = minimist(process.argv.slice(2))
const filepath = args['privateKeyPath']// --privateKeyPath

const connConfig = {
  host: 'ip',
  port: 22,
  username: 'user',
  privateKey: readFileSync('filepath'),
};

const ssh = new SSH();
await ssh.open(connConfig);
await ssh.exec('uptime');

安装

pnpm i @trans.js/node-ssh-client
# 或者
yarn add @trans.js/node-ssh-client
2.0.0

8 months ago

1.0.1

10 months ago

1.0.0

10 months ago