mirror of https://github.com/nocodb/nocodb
Wing-Kam Wong
2 years ago
17 changed files with 81 additions and 41 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