constgsync=require('gcloud-sync');// customizing options up-frontconstgsync=require('gcloud-sync')({parallelLimit: 2});// making an instance available to other filesconstgsync=require('gcloud-sync');gsync.custom=gsync({parallelLimit: 2});// freeing memory: delete gsync.custom// if Promise isn't definedglobal.Promise=require('promise-module');vargsync=require('gcloud-sync');
Synchronizing store data
gsync.execute({// MANDATORY FIELDS and example valuesprojectId: 'uniqueProjectId',keyFilename: __dirname+'/key.json',bucket: 'pubsite_prod_rev_<developer-id>',prefix: 'stats/installs/installs_',outputDirectory: __dirname+'/sync-bucket',// OPTIONAL FIELDS and example valuesnameSelector: function(name){returnname.indexOf('2016')>-1;},}).then(()=>console.log('Done.')).catch(console.error);