1.0.5 • Published 8 years ago

gcloud-sync v1.0.5

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

Google Cloud Storage synchronisation utility

Installation

$ npm install --save gcloud-sync

Usage

const gsync = require('gcloud-sync');

// customizing options up-front
const gsync = require('gcloud-sync')({ parallelLimit: 2 });

// making an instance available to other files
const gsync = require('gcloud-sync');
gsync.custom = gsync({ parallelLimit: 2 });
// freeing memory: delete gsync.custom

// if Promise isn't defined
global.Promise = require('promise-module');
var gsync = require('gcloud-sync');

Synchronizing store data

gsync.execute({

  // MANDATORY FIELDS and example values

  projectId: 'uniqueProjectId',
  keyFilename: __dirname + '/key.json',
  bucket: 'pubsite_prod_rev_<developer-id>',
  prefix: 'stats/installs/installs_',
  outputDirectory: __dirname + '/sync-bucket',

  // OPTIONAL FIELDS and example values

  nameSelector: function(name) {
    return name.indexOf('2016') > -1;
  },

}).then(() => console.log('Done.'))
.catch(console.error);
1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago