Skip to content

jibbex/scp-promises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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{})

property description
host URL or IP Address of the host
user Login Username
password optional
port 22 is default

send(options : @Object{})

property description
destination The path to the remote file
source The local file

get(options : @Object{})

property description
source The path to the remote file
destination The local file

Fat properties are required.

About

A Node.js module for asynchronous scp uploads and downloads.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published