workerd-ftp
A powerful FTP client designed specifically for Cloudflare Workers, leveraging the TCP Sockets API to enable FTP operations in serverless environments.Why workerd-ftp?
Cloudflare Workers provide a powerful edge computing platform, but traditional FTP clients don’t work in this environment. workerd-ftp bridges this gap by using Cloudflare’s TCP Sockets API to provide full FTP functionality in your Workers.Serverless-first
Built specifically for Cloudflare Workers runtime with TCP Sockets support
Secure transfers
FTPS support via TLS encryption for secure file operations
Stream-based
Download and upload files using modern ReadableStream and WritableStream interfaces
Full-featured
Complete FTP operations including list, upload, download, rename, and delete
Key features
Passive mode only
workerd-ftp operates in passive mode, as Cloudflare Workers only support outgoing TCP connections. This is the standard mode for most modern FTP operations.FTPS via TLS
Secure your file transfers with built-in TLS support. Enable encryption by setting thesecure option to true when connecting.
Stream-based file operations
Upload and download files efficiently using the Web Streams API:- Downloads: Get files as
ReadableStream<Uint8Array>for processing chunks as they arrive - Uploads: Use
WritableStream<Uint8Array>to send data without loading entire files into memory
Complete file management
Perform all essential FTP operations:- List directory contents with detailed file information
- Create and remove directories
- Upload and download files
- Rename and delete files and directories
- Get file metadata (size, modification time)
- Navigate directory structures
Use cases
Backup automation
Automatically back up files to FTP servers from your Workers
File synchronization
Sync files between FTP servers and cloud storage
Content delivery
Upload generated content or media files to FTP servers
Legacy integration
Connect modern edge applications with legacy FTP-based systems
Requirements
To use workerd-ftp, you need:- A Cloudflare Workers Paid plan with TCP Sockets enabled
- Node.js 18+ for development
- An FTP server to connect to
Quick example
Here’s a simple example showing how to connect and upload a file:Next steps
Installation
Install workerd-ftp in your project
Quick start
Get started with your first FTP connection