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

node-red-contrib-ftp

v0.0.8

Published

A Node-RED node to FTP Client.

Downloads

1,237

Readme

node-red-contrib-ftp

Japanese

A Node-RED node to FTP Server.

NPM

Pre-requisites

The node-red-contrib-ftp requires Node-RED to be installed.

Install

Run the following command in the root directory of your Node-RED install

npm install node-red-contrib-ftp

Restart your Node-RED instance, the ftp node and sftp node appears in the palette and ready for use.

Usage

node-red-contrib-force contains the following modules.

ftp node

This node will allow you to LIST, GET, PUT, APPEND, DELETE and MKDIR files on a remote FTP server.

The GET, PUT and APPEND options use msg.filename (the path/name of the file on the remote machine) and msg.localFilename (buffer or the path/name of the file on the local machine - i.e. the one running NR).

The DELETE option only specifies msg.filename (the path/name of the file on the remote machine)

The LIST option returns an array of the file/folders in the user's default ftp folder, containing type, name, sticky, rights(an object), acl, owner, group, size and date. Also, returns an array of files/folders in a subfolder by specifying msg.filename (the path of the folder on the remote machine).

The MKDIR option only specifies msg.filename (the directory name on the remote machine).

Example

[{"id":"91039113.5ae0b8","type":"debug","z":"e052b363.bcca48","name":"","active":true,"console":"false","complete":"payload","x":494,"y":72,"wires":[]},{"id":"ebf6cb8.83c77b8","type":"inject","z":"e052b363.bcca48","name":"","topic":"","payload":"","payloadType":"none","repeat":"","crontab":"","once":false,"x":114,"y":141,"wires":[["18704d55.fa8d63"]]},{"id":"18704d55.fa8d63","type":"function","z":"e052b363.bcca48","name":"","func":"msg.filename = 'test.csv';\nmsg.localFilename = '/Users/xxx/Desktop/test_remote.csv';\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":141,"wires":[["6f4f3dda.a20a7c"]]},{"id":"6f4f3dda.a20a7c","type":"ftp in","z":"e052b363.bcca48","ftp":"a7676b1a.e9714","operation":"delete","filename":"","localFilename":"","name":"","x":440,"y":143,"wires":[["be82074.47a8878"]]},{"id":"8e30f382.5971f8","type":"inject","z":"e052b363.bcca48","name":"","topic":"","payload":"","payloadType":"none","repeat":"","crontab":"","once":false,"x":108,"y":67,"wires":[["be82074.47a8878"]]},{"id":"be82074.47a8878","type":"ftp in","z":"e052b363.bcca48","ftp":"a7676b1a.e9714","operation":"list","filename":"","localFilename":"","name":"","x":276,"y":68,"wires":[["91039113.5ae0b8"]]},{"id":"a7676b1a.e9714","type":"ftp","z":"","host":"xxx.xxx.xxx.xxx","port":"21","secureOptions":"","user":"username","connTimeout":"","pasvTimeout":"","keepalive":""}]

sftp node

This node will allow you to LIST, GET, PUT, APPEND, DELETE and MKDIR files on a remote SFTP server.

The GET, PUT and APPEND options use msg.filename (the path/name of the file on the remote machine) and msg.localFilename (buffer or the path/name of the file on the local machine - i.e. the one running NR).

The DELETE option only specifies msg.filename (the path/name of the file on the remote machine)

LIST options msg.path (Remote directory path) and msg.pattern (A pattern used to filter the items included in the returned array). Returns an array of listings in the specified sftp directory, containing type, name, size, modifyTime, accessTime, rights(an object), owner and group.

The MKDIR option only specifies msg.filename (the directory name on the remote machine).

Example

[{"id":"91039113.5ae0b8","type":"debug","z":"f6ce9dfc.b7e04","name":"","active":true,"tosidebar":true,"console":false,"complete":"payload","statusVal":"","statusType":"auto","x":490,"y":55,"wires":[]},{"id":"ebf6cb8.83c77b8","type":"inject","z":"f6ce9dfc.b7e04","name":"","repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"none","x":110,"y":129,"wires":[["18704d55.fa8d63"]]},{"id":"18704d55.fa8d63","type":"function","z":"f6ce9dfc.b7e04","name":"","func":"msg.filename = 'test.csv';\nmsg.localFilename = '/Users/xxx/Desktop/test_remote.csv';\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":266,"y":129,"wires":[["ace5a559.4976f8"]]},{"id":"8e30f382.5971f8","type":"inject","z":"f6ce9dfc.b7e04","name":"","props":[{"p":"payload","v":"","vt":"str"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"str","x":104,"y":55,"wires":[["d4a445a5.67f7b8"]]},{"id":"d4a445a5.67f7b8","type":"sftp in","z":"f6ce9dfc.b7e04","sftp":"4cce8fdd.46c2e","operation":"list","path":"./","pattern":"","filename":"","localFilename":"","name":"","x":267,"y":55,"wires":[["91039113.5ae0b8"]]},{"id":"ace5a559.4976f8","type":"sftp in","z":"f6ce9dfc.b7e04","sftp":"4cce8fdd.46c2e","operation":"delete","path":"","pattern":"","filename":"","localFilename":"","name":"","x":431,"y":129,"wires":[["d4a445a5.67f7b8"]]},{"id":"4cce8fdd.46c2e","type":"sftp","host":"xxx.xxx.xxx.xxx","port":"22","forceIPv4":false,"forceIPv6":false,"username":"username","privateKey":"","readyTimeout":"","strictVendor":true,"debug":"// function - Set this to a function that receives a single \n// string argument to get detailed (local) debug information.","retries":"","retry_factor":"","retry_minTimeout":""}]

Acknowledgements

The node-red-contrib-ftp uses the following open source software:

  • node-ftp: node-ftp is an FTP client module for node.js that provides an asynchronous interface for communicating with an FTP server.
  • ssh2-sftp-client: ssh2-sftp-client is an SFTP client for node.js, a wrapper around SSH2 which provides a high level convenience abstraction as well as a Promise based API.

License

See license (Apache License Version 2.0).

Contributing

Both submitting issues to GitHub issues and Pull requests are welcome to contribute.

Developers

If the developer wants to modify the source of node-red-contrib-ftp, run the following code to create a clone.

cd ~\.node-red\node_modules
git clone https://github.com/joeartsea/node-red-contrib-ftp.git
cd node-red-contrib-ftp
npm install