Open nikhilkalburgi opened 1 year ago
FTP for Node.js
A simple, efficient FTP client for Node.js that enables file transfers, management, and server interaction using the FTP protocol. This project aims to provide a straightforward way to connect, upload, download, and manage files on FTP servers.
🚀 Features
Error handling: Provides detailed error reports for debugging.
📦 Installation
npm install ftp-for-node
🔧 Usage
Here's a quick example of how to use ftp-for-node
:
const FTPClient = require('ftp-for-node');
// Initialize FTP client
const client = new FTPClient({
host: 'ftp.example.com',
port: 21,
user: 'username',
password: 'password',
});
// Connect to the FTP server
client.connect()
.then(() => {
// Upload a file
return client.upload('/local/path/to/file.txt', '/remote/path/file.txt');
})
.then(() => {
console.log('File uploaded successfully!');
// Download a file
return client.download('/remote/path/file.txt', '/local/path/to/download/file.txt');
})
.then(() => {
console.log('File downloaded successfully!');
client.disconnect(); // Close the connection
})
.catch((err) => {
console.error('FTP Error:', err);
});
connect()
: Establishes a connection to the FTP server.upload(localPath, remotePath)
: Uploads a file to the remote FTP server.download(remotePath, localPath)
: Downloads a file from the FTP server.delete(remotePath)
: Deletes a file from the FTP server.disconnect()
: Disconnects from the FTP server.For a full list of available methods and advanced usage, please check out the API Documentation.
We welcome contributions! Please check out our Contribution Guidelines for more information.
git checkout -b feature-branch
git commit -m 'Add some feature'
git push origin feature-branch
🐛 Issues
Have a bug or an issue? Please check out the issues page or open a new issue with a detailed description of the problem.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
💬 Support
If you need help, feel free to reach out or open an issue.
Happy coding!
I want the readme to be improved