1.3.0 • Published 6 years ago

@ryanburnette/s3-upload-file v1.3.0

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

s3-upload-file

repo npm

Upload a file to AWS S3 using Node.js.

Usage

require('@ryanburnette/s3-upload-file')({
  // optional cwd to keep paths relative
  cwd: 'demo/',

  // path to file relative to project or cwd
  filePath: 'dir/file.txt',

  // https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-credentials-node.html
  s3: new require('aws-sdk').S3(),

  // uploadOpts will be passed to S3.upload
  // Key and Body will be set for you
  // Bucket must be provided
  // ContentType will be set for you if not provided here
  uploadOpts: {
    Bucket: 'my-bucket'
  },

  // optionally prefix the remote path
  remotePathPrefix: 'foo'
}).then(function(result) {
  console.log(result);
});
1.3.0

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago