@trans.js/node-ssh-client
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@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

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

    Package Sidebar

    Install

    npm i @trans.js/node-ssh-client

    Weekly Downloads

    1

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    52.2 kB

    Total Files

    5

    Last publish

    Collaborators

    • jack0410