https://github.com/nullobsi/ftpdeno
FTP Client for Deno
https://github.com/nullobsi/ftpdeno
Last synced: about 1 year ago
JSON representation
FTP Client for Deno
- Host: GitHub
- URL: https://github.com/nullobsi/ftpdeno
- Owner: nullobsi
- License: mit
- Created: 2020-12-23T20:04:08.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-05-17T23:41:47.000Z (about 2 years ago)
- Last Synced: 2025-04-24T00:07:38.309Z (about 1 year ago)
- Language: TypeScript
- Size: 57.6 KB
- Stars: 11
- Watchers: 1
- Forks: 4
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# FTPDeno
Pure TypeScript FTP Client for Deno. [Docs here](https://doc.deno.land/https/deno.land/x/ftpc/mod.ts)
Tested using vsFTPd v3.0.3.
However, tests are not extensive; please report problems if they occur!
Supports:
* Active and passive mode
* Implicit and explicit TLS
* Downloading/uploading via Readable and Writable interfaces
* List files
* Deleting/creating directories and files
* Renaming files/directories
## Usage
This is also located in the Examples folder.
```ts
// Requires --allow-net and --allow-write
import { FTPClient } from "https://deno.land/x/ftpc/mod.ts";
// Connect as anonymous user
using client = new FTPClient("speedtest.tele2.net");
await client.connect();
console.log("Connected!");
// Download test file
console.log("Downloading...");
{
using file = await Deno.open("./5MB.zip", {
create: true,
write: true,
});
// Use Readable and Writable interface for fast and easy tranfers.
await using stream = await client.downloadReadable("5MB.zip");
await stream.pipeTo(file.writable);
} // Because of `await using`, finalizeStream is called and server is notified.
// Since we did `using`, connection is automatically closed.
console.log("Finished!");
```