0.8.2 • Published 11 months ago

scp-promises v0.8.2

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

scp-promises

A Node.js module for asynchronous SCP uploads and downloads. Inspired by node-scp, which is apparently no longer maintained.

About

CreateScpConnection returns an instance of Scp. The Scp object has get and send methods which return promises. If no password was passed to the the options object parameter of the called Constructor during initialization, the password prompt is piped to the terminal.

Getting Started

Run simply npm install or yarn add to install scp-promises

$ npm i scp-promises --save

OR

$ yarn add scp-promises

Import the module

import { CreateScpConnection } from 'scp-promise';

OR

Require the package

const { CreateScpConnection } = require('scp-promise');

Connect, down- and upload as much as you like

const scp = CreateScpConnection({host, user});
const sendMessage = await scp.send({ destination: `/home/${user}/testfile.md`, source: './README.md'});
const getMessage  = await scp.get({ source: `/home/${user}/testfile.md`, destination: './testfile.md'});

For a more detailed example, visit /example.

class Scp

CreateScpConnection(options : @Object{})

propertydescription
hostURL or IP Address of the host
userLogin Username
passwordoptional
port22 is default

send(options : @Object{})

propertydescription
destinationThe path to the remote file
sourceThe local file

get(options : @Object{})

propertydescription
sourceThe path to the remote file
destinationThe local file

Fat properties are required.

0.8.11

11 months ago

0.8.1

11 months ago

0.8.0

11 months ago

0.8.2

11 months ago

0.5.0

3 years ago

0.4.85

3 years ago

0.4.8

3 years ago

0.4.6

3 years ago

0.4.5

3 years ago