ftp-srv is a modern and extensible FTP server library for Node.js, currently stable at version 4.6.3. It provides a promise-based API for creating FTP and FTPS (Explicit & Implicit TLS) servers with support for both passive and active data transfers. The project maintains an active release cadence, frequently publishing bug fixes and minor features, as seen in recent updates like recursive directory creation and TypeScript declaration improvements. Its key differentiators include a highly extensible file system per connection, allowing for custom storage backends, and comprehensive support for various FTP commands and connection modes. It differentiates itself by offering detailed control over passive connection URLs and port ranges, addressing complexities often found in network deployments behind NATs or firewalls. It requires Node.js version 12 or higher.
npm install ftp-srvVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to initialize an FTP server, handle anonymous logins, and specify a root directory. It includes basic error handling and prepares a dummy `ftp_root` directory in the current working directory, making it fully runnable out of the box.
Upgrade to `ftp-srv@4.3.4` or newer immediately to mitigate the vulnerability and ensure secure operation.
Set `pasv_url` to your server's static external IP address or provide a resolver function that returns the correct external IP based on the client's connection. Example: `new FtpSrv({ pasv_url: 'YOUR_EXTERNAL_IP' });`To allow external connections, configure the `url` option to listen on all available network interfaces using `url: "ftp://0.0.0.0:21"`.
Ensure your Node.js environment is updated to version 12 or newer. The `engines` field in the package's `package.json` specifies this minimum requirement.
Change the `port` in the `url` option to an available port, or ensure no other process is listening on the desired port before starting `ftp-srv`. On Linux, you can use `lsof -i :<port>` to find the process.
Review your `login` event handler to ensure it correctly resolves credentials. Verify that the username and password being sent by the FTP client match the expected values defined in your server-side logic.
Configure the `pasv_url` option with your server's external (WAN) IP address and ensure that the port range specified by `pasv_min` and `pasv_max` is open and accessible through your firewall.
No dependency data recorded yet.