Skip to content

Zips files from the cloud to the cloud

License

Notifications You must be signed in to change notification settings

bbaald/zip-to-cloud

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

zip-to-cloud

This is a library that will zip files from the cloud back to the cloud.

const ZipToCloud = require('zip-to-cloud')
const AWS = require('aws-sdk')

const ztc = new ZipToCloud({
  s3: new AWS.S3(),
  bucket: 'mybucket'
});

/**
* Note, each object must be in the format
*  { 
*    s3:  'path/to/file/on/s3', 
*    zip: 'where/to/put/file/on/zip' 
*  }
*  If you want a custom file to be added,
*  {
*    file: 'This can be a String, ArrayBuffer, Uint8Array, Buffer, Blob, Promise or stream',
*    zip: 'where/to/put/file/on/zip'
*  }
*/

ztc.addFiles([
  {
    s3:  'myfile.png',
    zip: 'path/to/myfile.png'
  },
  {
    s3:  'myotherfile.png',
    zip: 'different/path/to/myotherfile.png'
  },
  {
    file: 'My final file',
    zip: 'path/to/my/best/file.txt'
  }
])
  .then(() => {
    return ztc.zipAndUpload('path/to/s3/file.zip')
  })

Installation

npm install zip-to-cloud

API

ztc.addFile(file)
ztc.addFiles(files)
ztc.zipAndUpload(to)

About

Zips files from the cloud to the cloud

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%