Skip to content

Commit

Permalink
Fixes #2
Browse files Browse the repository at this point in the history
  • Loading branch information
f2face committed Jun 17, 2024
1 parent e8e4de7 commit 87a0206
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "node-cloudflare-r2",
"version": "0.2.1",
"version": "0.2.2",
"description": "S3 wrapper for Cloudflare R2.",
"main": "./lib/index.js",
"scripts": {
Expand Down
7 changes: 6 additions & 1 deletion src/Bucket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,12 @@ export class Bucket {
): Promise<UploadFileResponse> {
const fileStream = createReadStream(file);
try {
const result = this.upload(fileStream, destination || basename(file.toString()), customMetadata, mimeType);
const result = await this.upload(
fileStream,
destination || basename(file.toString()),
customMetadata,
mimeType
);
fileStream.close();
return result;
} catch (error) {
Expand Down

0 comments on commit 87a0206

Please sign in to comment.