1.0.4 • Published 3 years ago

cloud-bucket-migrator v1.0.4

Weekly downloads
1
License
ISC
Repository
-
Last release
3 years ago

cloud-bucket-migrator

A lightweight library to migrate cloud buckets. It includes : upload a local directory to a remote cloud bucket, download a bucket to a local directory or transfer an origin bucket to a target bucket.

Features

  • Download a bucket
  • Upload a local directory to a bucket
  • Migrate a bucket ( Cross-Account supported )

Support

Currently only AWS S3 buckets operations are supported.

Installation

$ npm install cloud-bucket-migrator

Loading the module

const cloudBucketMigrator = require('cloud-bucket-migrator');

Common Usage

Download bucket

const path = 'LOCAL_PATH'; 
const platform = 'AWS_S3';
const bucketName = 'ORIGIN_BUCKET_NAME';
const credentials = {
    accessKey: 'ACCESS_KEY',
    secretKey:  'SECRET_KEY'
}

(async function() {
    await cloudBucketMigrator.downloadBucket(platform, credentials, bucketName, path);
})();

Upload bucket

const path = 'LOCAL_PATH'; 
const platform = 'AWS_S3';
const bucketName = 'TARGET_BUCKET_NAME';
const credentials = {
    accessKey: 'ACCESS_KEY',
    secretKey:  'SECRET_KEY'
}

(async function() {
    await cloudBucketMigrator.uploadBucket(platform, credentials, bucketName, path);
})()

Migrate bucket

const originPlatform = 'AWS_S3';
const originBucketName = 'ORIGIN_BUCKET_NAME';
const originCredentials = {
    accessKey: 'ORIGIN_ACCESS_KEY',
    secretKey:  'ORIGIN_SECRET_KEY'
}

const targetPlatform = 'AWS_S3';
const targetBucketName = 'TARGET_BUCKET_NAME';
const targetCredentials = {
    accessKey: 'TARGET_ACCESS_KEY',
    secretKey:  'TARGET_SECRET_KEY'
}

(async function() {
    await cloudBucketMigrator.migrateBucket(originPlatform, credentials, originBucketName, targetPlatform, credentials, targetBucketName);       
})();

License

MIT

1.0.4

3 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago