Natural Pacifist Manatees
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    awssum-greenqloud-s3public

    awssum-greenqloud-s3

    This is an AwsSum plugin!

    You'll need to add awssum-greenqloud-s3 to your package.json dependencies. Both awssum and awssum-greenqloud are pulled in as peer dependencies.

    Example

    List all your buckets:

    var fmt = require('fmt');
    var greenqloudS3 = require('awssum-amazon-s3');
    
    var s3 = new greenqloudS3.S3({
        'accessKeyId'     : process.env.ACCESS_KEY_ID,
        'secretAccessKey' : process.env.SECRET_ACCESS_KEY,
        'region'          : greenqloudS3.IS_1
    });
    
    s3.ListBuckets(function(err, data) {
        fmt.dump(err, 'err');
        fmt.dump(data, 'data');
    });
    

    Streaming

    Streaming uploads:

    var fmt = require('fmt');
    var greenqloudS3 = require('awssum-amazon-s3');
    
    var s3 = new greenqloudS3.S3({
        'accessKeyId'     : process.env.ACCESS_KEY_ID,
        'secretAccessKey' : process.env.SECRET_ACCESS_KEY,
        'region'          : greenqloudS3.IS_1
    });
    
    // you must run fs.stat to get the file size for the content-length header (s3 requires this)
    fs.stat(__filename, function(err, file_info) {
        var bodyStream = fs.createReadStream( __filename );
    
        var options = {
            BucketName    : bucket,
            ObjectName    : 'amazon.js',
            ContentLength : file_info.size,
            Body          : bodyStream
        };
    
        s3.PutObject(options, function(err, data) {
            fmt.dump(err, 'err');
            fmt.dump(data, 'data');
        });
    });
    

    Streaming downloads:

    var fmt = require('fmt');
    var greenqloudS3 = require('awssum-amazon-s3');
    
    var s3 = new greenqloudS3.S3({
        'accessKeyId'     : process.env.ACCESS_KEY_ID,
        'secretAccessKey' : process.env.SECRET_ACCESS_KEY,
        'region'          : greenqloudS3.IS_1
    });
    
    var options = {
        BucketName    : 'pie-17',
        ObjectName    : 'javascript-file.js',
    };
    
    s3.GetObject(options, { stream : true }, function(err, data) {
        fmt.dump(err, 'err');
        fmt.dump(data, 'data');
    
        // stream this file to stdout
        fmt.sep();
        fmt.title('The File');
        data.Stream.pipe(process.stdout);
        data.Stream.on('end', function() {
            fmt.sep();
        });
    });
    

    Operations

    ListBuckets

    Docs: ListBuckets on AWS

    DeleteBucket

    Docs: DeleteBucket on AWS

    DeleteBucketCors

    Docs: DeleteBucketCors on AWS

    DeleteBucketLifecycle

    Docs: DeleteBucketLifecycle on AWS

    DeleteBucketPolicy

    Docs: DeleteBucketPolicy on AWS

    DeleteBucketTagging

    Docs: DeleteBucketTagging on AWS

    DeleteBucketWebsite

    Docs: DeleteBucketWebsite on AWS

    ListObjects

    Docs: ListObjects on AWS

    GetBucketAcl

    Docs: GetBucketAcl on AWS

    GetBucketCors

    Docs: GetBucketCors on AWS

    GetBucketLifecycle

    Docs: GetBucketLifecycle on AWS

    GetBucketPolicy

    Docs: GetBucketPolicy on AWS

    GetBucketTagging

    Docs: GetBucketTagging on AWS

    GetBucketLocation

    Docs: GetBucketLocation on AWS

    GetBucketLogging

    Docs: GetBucketLogging on AWS

    GetBucketNotification

    Docs: GetBucketNotification on AWS

    GetBucketObjectVersions

    Docs: GetBucketObjectVersions on AWS

    GetBucketRequestPayment

    Docs: GetBucketRequestPayment on AWS

    GetBucketVersioning

    Docs: GetBucketVersioning on AWS

    GetBucketWebsite

    Docs: GetBucketWebsite on AWS

    CheckBucket

    Docs: CheckBucket on AWS

    ListMultipartUploads

    Docs: ListMultipartUploads on AWS

    CreateBucket

    Docs: CreateBucket on AWS

    PutBucketAcl

    Docs: PutBucketAcl on AWS

    PutBucketCors

    Docs: PutBucketCors on AWS

    PutBucketLifecycle

    Docs: PutBucketLifecycle on AWS

    PutBucketPolicy

    Docs: PutBucketPolicy on AWS

    PutBucketLogging

    Docs: PutBucketLogging on AWS

    PutBucketNotification

    Docs: PutBucketNotification on AWS

    PutBucketTagging

    Docs: PutBucketTagging on AWS

    PutBucketRequestPayment

    Docs: PutBucketRequestPayment on AWS

    PutBucketVersioning

    Docs: PutBucketVersioning on AWS

    PutBucketWebsite

    Docs: PutBucketWebsite on AWS

    DeleteObject

    Docs: DeleteObject on AWS

    DeleteMultipleObjects

    Docs: DeleteMultipleObjects on AWS

    GetObject

    Docs: GetObject on AWS

    GetObjectAcl

    Docs: GetObjectAcl on AWS

    GetObjectTorrent

    Docs: GetObjectTorrent on AWS

    GetObjectMetadata

    Docs: GetObjectMetadata on AWS

    OptionsObject

    Docs: OptionsObject on AWS

    PostObjectRestore

    Docs: PostObjectRestore on AWS

    PutObject

    Docs: PutObject on AWS

    PutObjectAcl

    Docs: PutObjectAcl on AWS

    CopyObject

    Docs: CopyObject on AWS

    InitiateMultipartUpload

    Docs: InitiateMultipartUpload on AWS

    UploadPart

    Docs: UploadPart on AWS

    UploadPartCopy

    Docs: UploadPartCopy on AWS

    CompleteMultipartUpload

    Docs: CompleteMultipartUpload on AWS

    AbortMultipartUpload

    Docs: AbortMultipartUpload on AWS

    ListParts

    Docs: ListParts on AWS

    Author

    Written by Andrew Chilton - Blog - Twitter.

    License

    (Ends)

    install

    npm i awssum-greenqloud-s3

    Downloadsweekly downloads

    9

    version

    1.4.3

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar