mirror of https://github.com/nocodb/nocodb
11 changed files with 36 additions and 19 deletions
@ -0,0 +1,16 @@
|
||||
import fs from 'fs'; |
||||
|
||||
export async function waitForStreamClose( |
||||
stream: fs.WriteStream |
||||
): Promise<void> { |
||||
return new Promise((resolve, reject) => { |
||||
stream |
||||
.once('finish', () => { |
||||
resolve(); |
||||
}) |
||||
.once('error', (err) => { |
||||
reject(err); |
||||
}); |
||||
stream.end(); |
||||
}); |
||||
} |
Loading…
Reference in new issue