Examples
The repository ships with runnable end-to-end examples in examples/. Each one is self-contained, typed, and safe to copy/paste as a starting point.
Connecting
Section titled “Connecting”| File | What it shows |
|---|---|
sftp-basic.ts | Password-auth SFTP, list + download. |
sftp-private-key.ts | Public-key SFTP with known_hosts and host-key pinning. |
ssh-exec-command.ts | Standalone SSH transport: handshake, auth, exec, drain stdout. |
ftp-basic.ts | Plain FTP with passive mode. |
ftps-basic.ts | Explicit FTPS with a CA bundle. |
ftps-client-certificate.ts | FTPS with mTLS + fingerprint pinning. |
profile-from-env.ts | Build a ConnectionProfile entirely from env vars. |
diagnose-connection.ts | Run connection diagnostics with redacted output. |
Cloud providers
Section titled “Cloud providers”| File | What it shows |
|---|---|
s3-compatible-upload.ts | Multipart upload to S3 (and any S3-compatible bucket). |
signed-url-download.ts | Resolve an HTTP signed URL and stream it to disk. |
webdav-sync.ts | One-way sync to a WebDAV server, with delete-policy. |
multi-cloud-orchestration.ts | Pull from S3, push to Azure Blob + GCS in parallel. |
Transfers, sync, MFT
Section titled “Transfers, sync, MFT”| File | What it shows |
|---|---|
local-copy-file.ts | Copy a file using the local filesystem provider. |
transfer-queue.ts | Bounded-concurrency queue with progress + retry. |
dry-run-sync.ts | Plan a sync, summarise it, decide whether to execute. |
atomic-deploy-with-rollback.ts | Stage → swap → rollback pattern for zero-downtime releases. |
mft-route.ts | Define a route + schedule + scheduler. |
approval-gated-route.ts | Wrap a route in a human-approval gate before bytes move. |
Running an example
Section titled “Running an example”# from repo rootnpm installnpm run build
# run with tsx (already a devDep)npx tsx examples/sftp-private-key.tsMost examples read connection details from environment variables - see the top of each file for the expected names. Use examples/profile-from-env.ts as a template for your own integrations.