npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

awssum-amazon-s3

v1.5.0

Published

AwsSum plugin for Amazon Simple Storage Service (S3).

Downloads

376

Readme

NOTE: AwsSum is now deprecated. Please use aws-sdk instead.

awssum-amazon-s3

This is an AwsSum plugin!

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

Example

List all your buckets:

var fmt = require('fmt');
var amazonS3 = require('awssum-amazon-s3');

var s3 = new amazonS3.S3({
    'accessKeyId'     : process.env.ACCESS_KEY_ID,
    'secretAccessKey' : process.env.SECRET_ACCESS_KEY,
    'region'          : amazonS3.US_EAST_1
});

s3.ListBuckets(function(err, data) {
    fmt.dump(err, 'err');
    fmt.dump(data, 'data');
});

Streaming

Streaming uploads:

var fmt = require('fmt');
var amazonS3 = require('awssum-amazon-s3');

var s3 = new amazonS3.S3({
    'accessKeyId'     : process.env.ACCESS_KEY_ID,
    'secretAccessKey' : process.env.SECRET_ACCESS_KEY,
    'region'          : amazonS3.US_EAST_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 amazonS3 = require('awssum-amazon-s3');

var s3 = new amazonS3.S3({
    'accessKeyId'     : process.env.ACCESS_KEY_ID,
    'secretAccessKey' : process.env.SECRET_ACCESS_KEY,
    'region'          : amazonS3.US_EAST_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)