2.0.24 • Published 6 years ago

s3-util v2.0.24

Weekly downloads
88
License
-
Repository
github
Last release
6 years ago

#s3-util

High-level utility for dealing with S3.

Enables syncronizing a local directory with a remote s3 bucket (uploading local files, deleting remote files not present locally).

Usage via the Command Line

# Install as a global executable
$ npm install -g s3-util
$ s3-util -h # print help

Usage via the API

# Install as a local package
$ npm install --save s3-util
// Inside a JavaScript file...

var s3Util = require('s3-util');

// Construct the client using keys
s3Util('my-s3-bucket', {
  awsAccessKeyId: 'abcdef',
  awsSecretAccessKey: '123456'
}).then(function(client){
  // operations on client
}).catch(function(err){
  // caught async errors
});

// Construct the client using EC2 IAM Role
s3Util('my-s3-bucket', {
  awsIAMRole: 'my-role'
}).then(function(client){
  // operations on client
}).catch(function(err){
  // caught async errors
});

// Synchronizes a local file, directory, or glob pattern with an s3 destination
// if a directory is passed in, all files in the S3 destination which are not
// present locally will be deleted.
client.sync(localSource, s3DestinationPath, uploadOptions);

client.copy(s3SourceDirectory, s3DestinationDirectory);

client.diff(localDirectoryPath, s3DirectoryPath);

client.head(s3FilePath);
client.list(s3DirectoryPath);
client.updateAcl(s3Path, aclString);

client.putStream(stream, s3DestinationPath, uploadOptions);
client.putFile(localFilePath, s3DestinationPath, uploadOptions);

client.deleteFile(s3FilePath);
client.deleteMultiple([s3FilePath1, s3FilePath2]);
client.deleteDirectory(s3DirectoryPath);
2.0.24

6 years ago

2.0.23

6 years ago

2.0.22

8 years ago

2.0.21

9 years ago

2.0.20

9 years ago

2.0.19

9 years ago

2.0.18

9 years ago

2.0.17

9 years ago

2.0.16

9 years ago

2.0.15

9 years ago

2.0.14

9 years ago

2.0.13

9 years ago

2.0.12

9 years ago

2.0.11

9 years ago

2.0.10

9 years ago

2.0.9

9 years ago

2.0.8

9 years ago

2.0.7

9 years ago

2.0.6

9 years ago

2.0.5

9 years ago

2.0.4

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.0

9 years ago