# scp-promises

> Asynchronous scp up- and download

Latest version **0.8.2** (published 2023-06-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install scp-promises
pnpm add scp-promises
yarn add scp-promises
bun add scp-promises
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.8.2 |
| Published | 2023-06-04 |
| First published | 2021-04-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 13.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Manfred Michaelis |
| Maintainers | jibbex |
| Keywords | scp, async, ssh |

## Links

- npm: https://www.npmjs.com/package/scp-promises
- Repository: https://github.com/jibbex/scp-promises
- Homepage: https://michm.de
- Issues: https://github.com/jibbex/scp-promises/issues
- npm.io page: https://npm.io/package/scp-promises

## Alternatives

- [@commercetools/sync-actions](https://npm.io/package/@commercetools/sync-actions.md) — 25.1K weekly downloads
- [cwait](https://npm.io/package/cwait.md) — 21.4K weekly downloads
- [@ledgerhq/hw-app-cosmos](https://npm.io/package/@ledgerhq/hw-app-cosmos.md) — 4.2K weekly downloads
- [@financial-times/o-loading](https://npm.io/package/@financial-times/o-loading.md) — 2.8K weekly downloads
- [fa](https://npm.io/package/fa.md) — 185 weekly downloads

## Recent versions

- 0.8.2 (latest) — 2023-06-04
- 0.8.11 — 2023-06-04
- 0.8.1 — 2023-06-04
- 0.8.0 — 2023-06-04
- 0.5.0 — 2021-04-10
- 0.4.85 — 2021-04-10
- 0.4.8 — 2021-04-10
- 0.4.6 — 2021-04-10
- 0.4.5 — 2021-04-10

## README

# scp-promises

A Node.js module for asynchronous SCP uploads and downloads. Inspired by [node-scp](https://github.com/ecto/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
```javascript
import { CreateScpConnection } from 'scp-promise';
```

***OR***

> Require the package
```javascript
const { CreateScpConnection } = require('scp-promise');
```

> Connect, down- and upload as much as you like
```javascript
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](https://github.com/jibbex/scp-promises/tree/master/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.

---
_Source: https://npm.io/package/scp-promises · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
