New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

workerd-ftp

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

workerd-ftp

[![npm version][npm-version-src]][npm-version-href] [![npm downloads][npm-downloads-src]][npm-downloads-href] [![bundle][bundle-src]][bundle-href] [![Codecov][codecov-src]][codecov-href]

  • 0.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
193
decreased by-36.72%
Maintainers
1
Weekly downloads
 
Created
Source

📁 Cloudflare Worker FTP Client

npm version npm downloads bundle Codecov

FTP Client for use inside Cloudflare Workers, using the Cloudflare Worker TCP Sockets API.

This package relies heavily on the groundwork provided by nullobsi/ftpdeno.

  • ☁️ Passive mode (as Cloudflare only supports outgoing TCP connections)
  • 🔐 FTPS via TLS
  • 📥 Downloading/uploading via Readable and Writable interfaces
  • 📂 List files
  • 🛠️ Creating directories and files
  • ✏️ Renaming directories and files
  • 🗑️ Deleting directories and files

Read more about the TCP Socket connect() API in the Cloudflare Blog: https://blog.cloudflare.com/workers-tcp-socket-api-connect-databases

Usage

Install package:

# npm
npm install workerd-ftp

# yarn
yarn add workerd-ftp

# pnpm
pnpm install workerd-ftp

# bun
bun install workerd-ftp

Import:

import { FTPClient } from "workerd-ftp";

const ftp = new FTPClient('$SERVER$', {
  port: 21,
  user: '$USER$',
  pass: '$PASS$',
  secure: false
})
await ftp.connect()

// get currend working directory
const cwd = await ftp.cwd()

// upload file
await ftp.upload('test.txt', new TextEncoder().encode('hello world'))

// download file
const file = await ftp.download('test.txt')
const text = new TextDecoder().decode(file)

Development

  • Clone this repository
  • Install latest LTS version of Node.js
  • Enable Corepack using corepack enable
  • Install dependencies using pnpm install
  • Run interactive tests using pnpm dev

License

Made with 💛

Published under MIT License.

FAQs

Package last updated on 02 May 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc