* Refactor workspace membership system * Create setup endpoint * Use Passport.js * Several updates and fixes
10 lines
371 B
TypeScript
10 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);
|
|
});
|
|
}
|