npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

integreat-transporter-ftp

v1.0.2

Published

(S)FTP transporter for Integreat

Downloads

84

Readme

FTP transport for Integreat

Transporter that lets Integreat send and receive data over ftp/sftp.

Note: We're only supporting fetching for now, except for deleting files in a virtual SFTP server. You may get from a remote FTP server and provide a virtual SFTP server for others to fetch from (and delete files).

npm Version Maintainability

Getting started

Prerequisits

Requires node v18 and Integreat v1.0.

Installing and using

Install from npm:

npm install integreat-transporter-ftp

Example of use:

import Integreat from 'integreat'
import ftp from 'integreat-transporter-ftp'
import defs from './config'

const resources = {
  transporters: { ftp },
}
const great = Integreat.create(defs, resources)

// ... and then dispatch actions as usual

Example source configuration:

{
  id: 'files',
  transporter: 'ftp',
  endpoints: [
    { options: { host: 'ftp.com', port: 22, uri: '/folder/latest.csv' } }
  ]
}

Note: The connect() method doesn't really connect, but instead returns a connection object with its own connect() method. The connection is made just in time and ended immidiately afterwards to keep SFTP connection from staying open.

Running a virtual SFTP server

Note: The virtual server does only support a root directory with a list of files. In the future, we plan to offer options to configure a folder structure that maps to different schemas and action params.

Add an incoming object to the options object an rund await great.listen() to run a virtual SFTP server.

The incoming options needs the following properties:

  • host: The host to listen to, e.g. 'localhost'
  • port: The port to listen to, e.g. 22
  • privateKey: The RSA Private Key to use for the SFTP server

The transporter will handle a lot of different SFTP requests, and will on a few occations dispatch actions to get data and meta information to return to the FTP client.

To get directory content (the list of "files"), this action will be dispatched:

{
  type: 'GET',
  payload: { path: '/', host: 'localhost', port: 22 }
}

To get content and meta information on one "file", this action will be dispatched:

{
  type: 'GET',
  payload: { path: '/', id: 'latest.csv', host: 'localhost', port: 22 }
}

Note that path is always set to the path, and the file name is used as an id.

Integreat will also add the payload parameter sourceService with the id of the FTP service.

Running the tests

The tests can be run with npm test.

Contributing

Please read CONTRIBUTING for details on our code of conduct, and the process for submitting pull requests.

License

This project is licensed under the ISC License - see the LICENSE file for details.