awsS3Promisified
A node module for interacting with Amazon S3. All functions use Bluebird promises.
Installation:
npm install aws-s3-promisified
Usage:
Option 1: environmental variables.
Set AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY as environment variables, then Node will configure AWS automatically.
var aws = ;
Option 2: set environment variables manually
var aws = accessKeyId: AWS_ACCESS_KEY_ID secretAccessKey: AWS_SECRET_ACCESS_KEY;
All these functions return a Bluebird promise.
// Upload a file to S3aws; // Download a file from S3 and save it locallyaws; // Get a URL for a file on S3 taht will expire in 8 hoursvar url = aws; // Get a ReadStream for a file on S3var readstream = aws; // List all the objects in a bucketaws; // List all the objects in a bucket starting with a specific prefix:aws; // Delete a file from S3aws; // Put a Buffer, streamObject or string on S3aws; // Copy an object on S3 from one location to anotheraws;
Testing:
These tests will store data on S3, they aren't just stubs. AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables must be defined.
npm test