mirror of
https://github.com/docmost/docmost.git
synced 2025-11-17 07:31:10 +10:00
Refactoring
* Refactor workspace membership system * Create setup endpoint * Use Passport.js * Several updates and fixes
This commit is contained in:
10
apps/server/src/integrations/storage/storage.utils.ts
Normal file
10
apps/server/src/integrations/storage/storage.utils.ts
Normal file
@ -0,0 +1,10 @@
|
||||
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);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user