fix(TMTV): The TMTV CSV file now has the correct name and contents (#5215)
This commit is contained in:
1 parent
fceb515a68
commit
522d2aa764
9 files changed
+94
-5
No files matched your search
@@ -0,0 +1,15 @@
|
||||
import { Readable } from 'stream';
|
||||
|
||||
const _streamToString = async (stream: Readable) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const chunks = [];
|
||||
stream.on('data', chunk => chunks.push(chunk));
|
||||
stream.on('error', err => reject(err));
|
||||
stream.on('end', () => resolve(Buffer.concat(chunks).toString('utf8')));
|
||||
});
|
||||
};
|
||||
|
||||
export const downloadAsString = async download => {
|
||||
const stream = await download.createReadStream();
|
||||
return _streamToString(stream);
|
||||
};
|
||||
Reference in new issue
Block a user