1.0.8 • Published 6 years ago

gc-storage-files v1.0.8

Weekly downloads
-
License
ISC
Repository
bitbucket
Last release
6 years ago

README

simple module for get set files from gcstorage

Installation

$ npm i gc-storage-files

Simple example

const gcstorage = require('gc-storage-files');
let config = {  secret : __dirname + "/tests-bfd5e24b1223.json",
                localPath : __dirname + "/google.com",
                remotePath : "spain/domains/google10.com",
                nameBucket : "webpagereplay2"
             }

var gcs = new gcstorage(config);

// params.

console.log(
    '\n====== befor upload============' +
    '\nlocalPath:     '  + gcs.LocalPath  +
    '\nremotePath:    '  + gcs.RemotePath +
    '\nnameBucket:    '  + gcs.NameBucket
  );

gcs.upload((e) => {
    if(e) console.log('error - ', e);
});

// set new params =>
gcs.LocalPath = __dirname + "/test.log";
gcs.RemotePath = "spain/domains/google10.com";
gcs.nameBucket = "webpagereplay2";

console.log(
    '\n====== befor download============' +
    '\nlocalPath:     '  + gcs.LocalPath  +
    '\nremotePath:    '  + gcs.RemotePath +
    '\nnameBucket:    '  + gcs.NameBucket
  );

gcs.download((e) => {
    if(e) console.log('error - ', e);
});

gcs.getFiles((e, res) => {
    if(e){ 
        console.log('error', e); 
    }else{
        res.forEach(element => {
            console.log(element.name);
        });
    }
});

// delete remote file gcs.RemotePath on bucket

gcs.deleteFile((e) => {
    if(e) console.log('error - ', e);
});
1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago