1.1.0 • Published 5 months ago
nanoweb-sync-ftp v1.1.0
nanoweb-sync-ftp
Nanoweb Sync FTP is a command-line tool for synchronizing files between a local directory and an FTP server. It supports different sync strategies and parallel uploads for efficiency.
Features
- Synchronizes local files to an FTP server.
- Supports multiple sync strategies:
sync
,merge
,force
. - Handles parallel uploads for improved performance.
- Supports secure FTP connections.
Installation
npm install -g nanoweb-sync-ftp
Usage
Sync Files
nanoweb-sync-ftp -host ftp.example.com -user username -pass password -local ./dist -remote /
Options
Option | Description | Default |
---|---|---|
-host | FTP server host | - |
-user | FTP username | - |
-pass | FTP password | - |
-port | FTP port | 21 |
-secure | Use secure FTP connection | false |
-acceptUnauthorized | Accept unauthorized certificates (TLS) | false |
-parallel | Number of parallel uploads | 1 |
-strategy | Sync strategy (sync , merge , force ) | sync |
-local | Local directory to upload | dist |
-remote | Remote FTP directory | / |
-recent | Cache file for faster synchronization | .nanoweb-sync.json |
-public | Public directory to merge before upload | - |
Environment Variables
Alternatively, you can define settings in a .env
file:
FTP_HOST=ftp.example.com
FTP_USER=username
FTP_PASS=password
FTP_PORT=21
FTP_SECURE=false
FTP_PARALLEL_UPLOADS=1
FTP_ACCEPT_UNAUTHORIZED=true
SYNC_STRATEGY=sync
SYNC_LOCAL=dist
SYNC_REMOTE=/
SYNC_PUBLIC=public
SYNC_CACHE=.nanoweb-sync.json
License
Contributing
See CONTRIBUTING.md for details on how to contribute.