aws-s3-async
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

aws-s3-async

License: MIT

AWS S3 helper package for async. (callback-style functions to async functions)

I will add them one by one if necessary. Not all features are implemented. I will also provide additional convenience features.

install

npm install aws-s3-async --save

Implemented Features

  • getObjectAsync(params: GetObjectRequest, fileName: string): Promise<string>
const FILE_NAME = "/tmp/temp.jpg";
await getObjectAsync({Bucket: "BUCKET_NAME", Key: "KEY"}, FILE_NAME)
const image = fs.readfilesync(FILE_NAME);
  • putObjectAsync(params: PutObjectRequest, fileName: string)
const FILE_NAME = "/tmp/temp.jpg";
await putObjectAsync({Bucket: "BUCKET_NAME", Key: "KEY"}, FILE_NAME)
  • listObjectsAsync(params: ListObjectsRequest)
const params: ListObjectsRequest  = {Bucket: "BUCKET_NAME", Prefix: "PREFIX", Marker: "START_OBJECT"};
const result = await listObjectsAsync(params);
console.info(JSON.stringify(result, null, 2));
  • listAllKeysAsync(params: ListObjectsRequest): Promise<string[]> : Promise style
const result = await listAllKeysAsync({Bucket: "BUCKET_NAME", Prefix: "PREFIX"});
console.info(JSON.stringify(result, null, 2));
  • listAllKeysRx(params: ListObjectsRequest): Rx.Observable<any> : ReactiveX style
await listAllKeysRx({Bucket: "BUCKET_NAME", Prefix: "PREFIX"})
    .map(console.info)
    .toPromise();
  • listAllKeys(params:ListObjectsRequest , nextFunction: (data: any) => void) : Callback style
await listAllKeys({Bucket: "BUCKET_NAME", Prefix: "PREFIX"}, console.info);

Author

Yun.Seok-Joon

License

Toggler is available under the MIT license. See the LICENSE file for more info.

Readme

Keywords

Package Sidebar

Install

npm i aws-s3-async

Weekly Downloads

2

Version

1.0.4

License

MIT

Unpacked Size

9.72 kB

Total Files

6

Last publish

Collaborators

  • yun.seok-joon