Socket
Book a DemoInstallSign in
Socket

@tpisto/ftp-any-get

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tpisto/ftp-any-get

Node.js native module to get file from FTP, FTPS and SFTP sources.

0.1.7
latest
npmnpm
Version published
Maintainers
1
Created
Source

Node.js native module to get file from FTP, FTPS and SFTP sources.

ftp-any-get

CI

Motivation 🧐

  • Easy to install
  • Easy to use. Just single async function: "getFile".
  • 0 npm package dependencies

How to use šŸ“š

Get file from the ftp server (index.mjs)

import { getFile } from "@tpisto/ftp-any-get"

async function main() {
  // Fetch from FTP server
  let ftpFile = await getFile("ftp://demo:password@my-ftp-server.net/my-file.txt");

  // Fetch from FTP server using TLS
  let ftpsFile = await getFile("ftps://demo:password@my-ftp-server.net/my-file.txt");

  // Fetch file using SFTP. SFTP runs over the SSH protocol.
  let sftpFile = await getFile("sftp://demo:password@my-ftp-server.net/my-file.txt");
}
main();

If you want to accept_invalid_certs 😮, you can disable cert checks by adding "accept_invalid_certs" parameter to function.

import { getFile } from "@tpisto/ftp-any-get"

async function main() {
  // Fetch from FTP server using TLS and use "danger_accept_invalid_certs"
  let ftpsFile = await getFile("ftps://demo:password@my-ftp-server.net/my-file.txt", true);
}
main();

Install ☁

npm install @tpisto/ftp-any-get

or

yarn add @tpisto/ftp-any-get

Supported platforms (macOS M1 and x86_64, Linux ARM and x86_64)

  • x86_64-apple-darwin
  • aarch64-apple-darwin
  • x86_64-unknown-linux-gnu
  • aarch64-unknown-linux-gnu

Install notes (Ubuntu/Debian)

āš ļø You need to have "ca-certificates" installed in the system. For example "node:16" docker container has that already, but "node:16-slim" does not. So in "slim" containers you need to install "ca-certificates" package. If you do not have "ca-certificates" in your system, you can use "FTP" and "SFTP", but "FTPS" will fail with error thread 'tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: SecureError("error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed:ssl/statem/statem_clnt.c:1914: (unable to get local issuer certificate)")', src/ftp_ftps.rs:24:8

Automatically tested Node.js versions

node12node14node16
macOS x64āœ“āœ“āœ“
macOS aarch64āœ“āœ“āœ“
Linux x64 gnuāœ“āœ“āœ“
Linux aarch64 gnuāœ“āœ“āœ“

This Node.js native module is written in Rust. Powered by:

Keywords

ftp

FAQs

Package last updated on 06 May 2022

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with āš”ļø by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.