You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
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
Version published
Weekly downloads
6
500%
Maintainers
1
Weekly downloads
 
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

FTP

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