JSPM

  • Created
  • Published
  • Downloads 7
  • Score
    100M100P100Q61802F
  • License MIT

HiveSsh simplifies SSH2 connections via promise-based task execution on Linux servers with built-in server utilities and powerful command execution functions

Package Exports

    This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hivessh) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

    Readme

    HiveSsh

    CI/CD MIT typescript npm github

    Table of Contents

    About

    HiveSsh simplifies SSH2 connections via promise-based task execution on Linux servers with built-in server utilities and powerful command execution functions.

    HiveSsh is a library designed to streamline SSH2 connections and task execution on Linux servers. It provides user-friendly promise-based functions for efficient server operations without the need for a client application.

    Key Features

    HiveSsh offers the following key features:

    • All-Distributions: SSH2 and SFTP operations for all Linux servers
    • Promisified: Promise-based functions for ease of use
    • AbstractPackageManager: Built-in abstract package manager with support for apt, dnf, and yum, with additional configurability
    • Exec: Command execution utilities for event or promise-based error handling and output parsing, filtering, and mapping

    Requirements

    HiveSsh requires the following server environments:

    • SSH2 server
    • SFTP support
    • Linux distribution

    Getting started

    npm i hivessh
    import { SshHost } from "hivelib"
    
    //connect
    const myHost = await SshHost.connect({
        host: "127.0.0.1",
        //port: 22, (default 22)
        //user: "root", (default root)
    
        //password: "123456789",
        // or
        //privateKey: "..."
        // or
        //privateKeyPath:"/home/user/.ssh/id_rsa",
        //passphrase: "123456789"
    })
    
    // check files in user home dir
    const result = await myHost.exec("ls -al")
    console.log("Result: ", result.out)
    
    // check if a command exists
    const gitExist = await myHost.exists("git")
    console.log("Git exists: ", gitExist)
    
    // upgrade all packages using the abstract package manager
    const apm = await myHost.getApm()
    await apm.updateCache()
    await apm.upgradeAll()
    
    // install a package using the abstract package manager
    await apm.install("git")

    Technologies

    HiveSsh is built using the following technologies:

    • TypeScript
    • Node.js
    • SSH2
    • SFTP

    License

    HiveSsh is licensed under the MIT license, providing users with flexibility and freedom to use and modify the software according to their needs.

    Contributing

    Contributions to HiveSsh are welcome!
    Interested users can refer to the guidelines provided in the CONTRIBUTING.md file to contribute to the project and help improve its functionality and features.

    Disclaimer

    HiveSsh is provided without warranties.
    Users are advised to review the accompanying license for more information on the terms of use and limitations of liability.