@runnerty/executor-ftp
Version:
Runnerty module: FTP executor
109 lines (92 loc) • 2.79 kB
Markdown
<p align="center">
<a href="http://runnerty.io">
<img height="257" src="https://runnerty.io/assets/header/logo-stroked.png">
</a>
<p align="center">Smart Processes Management</p>
</p>
[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Dependency Status][david-badge]][david-badge-url]
<a href="#badge">
<img alt="code style: prettier" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg">
</a>
```bash
npm i @runnerty/executor-ftp
```
```json
{
"id": "ftp_default",
"type": "@runnerty-executor-ftp",
"host": "host.com",
"port": "21",
"username": "user",
"password": "1234"
}
```
```json
{
"id": "ftp_default",
"type": "@runnerty-executor-ftp",
"host": "host.com",
"port": "21",
"username": "user",
"privateKeyPath": "/privateKeys/myPrivateKey.pem"
}
```
Notas:
- Puedes usar `username` o `user` en la configuración; internamente se normaliza a `username`.
- Si usas autenticación por clave, utiliza `privateKeyPath` (ruta a fichero PEM) o `privateKey` (contenido PEM). Si `privateKey` apunta a un fichero existente, se leerá automáticamente.
```json
{
"id": "ftp_default",
"command": "PUT",
"sourcePath": "./sample.txt",
"destinationPath": "/remote/sample_file.txt"
}
```
```json
{
"id": "ftp_default",
"command": "LIST",
"sourcePath": "./remoteDir/"
}
```
Connection config you will see [here](https://github.com/mscdex/ssh2#user-content-client-methods)
* get: download a file.
* put: upload a file.
* mkdir: create a new directory.
* rmdir: remove the directory or file.
* delete: delete file.
* rename: rename sourcePath to destinationPath.
* chmod: modify rights to destinationPath file.
* list: retrieves a directory listing.
* `PROCESS_EXEC_DATA_OUTPUT`: Response output data.
* `EXTRA_DATA`: It is possible to work with the parsed values of the response.
`LIST` command return a JSON with this properties:
```bash
type: // file type(-, d, l)
name: // file name
size: // file size
modifyTime: // file timestamp of modified time
accessTime: // file timestamp of access time
rights: {
user:
group:
other:
},
owner: // user ID
group: // group ID
```
[]: http://www.runnerty.io
[]: https://img.shields.io/npm/dm/@runnerty/executor-ftp.svg
[]: https://www.npmjs.com/package/@runnerty/executor-ftp
[]: https://img.shields.io/npm/v/@runnerty/executor-ftp.svg
[]: https://david-dm.org/runnerty/executor-ftp.svg
[]: https://david-dm.org/runnerty/executor-ftp
[]: http://docs.runnerty.io/config/
[]: http://docs.runnerty.io/plan/