0.0.1 • Published 2 years ago

sshly v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

SSHly

A wrapper over the ssh2 module to make the API a little bit easier.

import { Ssh } from 'sshly'

const client = new Ssh({
    host: 'IP',
    privateKeyPath: 'my/private/key'
});


// Execute command
let { code, stdout, stderr } = await client.exec('whoami');

// Read file
let content: string = await client.readAsync('/etc/nginx/sites-available/default');

// Write to file
await client.writeAsync('/etc/nginx/sites-available/default', content);