mirror of
https://github.com/docmost/docmost.git
synced 2025-11-16 12:31:11 +10:00
* Refactor workspace membership system * Create setup endpoint * Use Passport.js * Several updates and fixes
11 lines
371 B
TypeScript
11 lines
371 B
TypeScript
import { Readable } from 'stream';
|
|
|
|
export function streamToBuffer(readableStream: Readable): Promise<Buffer> {
|
|
return new Promise((resolve, reject) => {
|
|
const chunks: Uint8Array[] = [];
|
|
readableStream.on('data', (chunk) => chunks.push(chunk));
|
|
readableStream.on('end', () => resolve(Buffer.concat(chunks)));
|
|
readableStream.on('error', reject);
|
|
});
|
|
}
|