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

ftp-bucket

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ftp-bucket

A FTP storage bucket implementation for NodeJS

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

FTP Bucket

Build Status npm version

A simple file storage for NodeJS using a FTP server.

Installation

npm install ftp-bucket

Note

Make sure directory listing is disable on the FTP server. To prevent directory listings, create a .htaccess file following which includes the following text:

IndexIgnore *

Reference

Example

const FTPBucket = require('ftp-bucket');

const bucketURL = 'sftp://username:password@example.com/path';

let bucket = new FTPBucket(bucketURL);

// Save stream
let stream = fs.createReadStream(...);
bucket.saveStream(stream)
    .then((info) => {
        console.log('id: ' + info.id); // id: 60f7ac7d-ae83-4c15-8c9d-710e2861bdde
    })
    .catch((err) => {
        console.log(err);
    });

// Get stream
const idGet = '60f7ac7d-ae83-4c15-8c9d-710e2861bdde';
bucket.getStream(idGet)
    .then((file) => {
        console.log('id: ' = file.id); // id: 60f7ac7d-ae83-4c15-8c9d-710e2861bdde
    })
    .catch((err) => {
        console.log(err);
    });

// Remove file
const idRemove = '60f7ac7d-ae83-4c15-8c9d-710e2861bdde';
bucket.remove(idRemove)
    .then((info) => {
        console.log('id: ' + info.id); // id: 60f7ac7d-ae83-4c15-8c9d-710e2861bdde
    })
    .catch((err) => {
        console.log(err);
    });

Documentation

TODO

Run Tests

TODO

Keywords

FAQs

Package last updated on 06 Apr 2018

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