-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: migrate to aws-sdk v3 * feat: updated config * refactor: little changes
- Loading branch information
Showing
6 changed files
with
1,393 additions
and
196 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import type { Readable } from 'stream'; | ||
import { Buffer } from 'buffer'; | ||
|
||
/** | ||
* Convert stream to buffer | ||
* @param stream - stream object | ||
* @returns buffer data made from stream | ||
*/ | ||
export const streamToBuffer = (stream: Readable): Promise<Buffer> => | ||
new Promise((resolve, reject) => { | ||
const chunks: Buffer[] = []; | ||
|
||
stream.on('data', (chunk: Buffer) => chunks.push(chunk)); | ||
stream.on('error', reject); | ||
stream.on('end', () => resolve(Buffer.concat(chunks))); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.