mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
19 lines
427 B
TypeScript
19 lines
427 B
TypeScript
import * as fs from 'fs';
|
|
import S3Stream = require('s3-upload-stream');
|
|
import * as AWS from 'aws-sdk';
|
|
|
|
const s3Stream = S3Stream(new AWS.S3());
|
|
|
|
const read = fs.createReadStream('/path/to/a/file');
|
|
const upload = s3Stream.upload({
|
|
Bucket: "bucket-name",
|
|
Key: "key-name",
|
|
ACL: "public-read",
|
|
StorageClass: "REDUCED_REDUNDANCY",
|
|
ContentType: "binary/octet-stream"
|
|
});
|
|
|
|
upload.concurrentParts(5);
|
|
|
|
read.pipe(upload);
|