Comparing version 0.1.2 to 0.1.3
{ | ||
"name": "hivessh", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "HiveSsh simplifies SSH2 connections via promise-based task execution on Linux servers with built-in server utilities and powerful command execution functions", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -46,5 +46,38 @@ # HiveSsh | ||
```sh | ||
npm i hivessh | ||
``` | ||
```ts | ||
//coming soon | ||
import {} | ||
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") | ||
``` | ||
@@ -51,0 +84,0 @@ |
93964
101