Skip to content

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.

FileWhat it shows
sftp-basic.tsPassword-auth SFTP, list + download.
sftp-private-key.tsPublic-key SFTP with known_hosts and host-key pinning.
ssh-exec-command.tsStandalone SSH transport: handshake, auth, exec, drain stdout.
ftp-basic.tsPlain FTP with passive mode.
ftps-basic.tsExplicit FTPS with a CA bundle.
ftps-client-certificate.tsFTPS with mTLS + fingerprint pinning.
profile-from-env.tsBuild a ConnectionProfile entirely from env vars.
diagnose-connection.tsRun connection diagnostics with redacted output.
FileWhat it shows
s3-compatible-upload.tsMultipart upload to S3 (and any S3-compatible bucket).
signed-url-download.tsResolve an HTTP signed URL and stream it to disk.
webdav-sync.tsOne-way sync to a WebDAV server, with delete-policy.
multi-cloud-orchestration.tsPull from S3, push to Azure Blob + GCS in parallel.
FileWhat it shows
local-copy-file.tsCopy a file using the local filesystem provider.
transfer-queue.tsBounded-concurrency queue with progress + retry.
dry-run-sync.tsPlan a sync, summarise it, decide whether to execute.
atomic-deploy-with-rollback.tsStage → swap → rollback pattern for zero-downtime releases.
mft-route.tsDefine a route + schedule + scheduler.
approval-gated-route.tsWrap a route in a human-approval gate before bytes move.
Terminal window
# from repo root
npm install
npm run build
# run with tsx (already a devDep)
npx tsx examples/sftp-private-key.ts

Most 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.