copied code from #12429

This commit is contained in:
Gabriel Grubba
2023-01-09 11:55:06 -03:00
parent dfd85f4a8f
commit 12dbae0fb2
2 changed files with 9 additions and 3 deletions

View File

@@ -7,8 +7,7 @@ Package.describe({
});
Npm.depends({
parse5: '3.0.2',
'stream-to-string': '1.1.0'
parse5: '6.0.1'
});
Package.onTest(function (api) {

View File

@@ -1,4 +1,11 @@
import streamToString from "stream-to-string";
function streamToString (stream) {
const chunks = [];
return new Promise((resolve, reject) => {
stream.on('data', (chunk) => chunks.push(Buffer.from(chunk)));
stream.on('error', (err) => reject(err));
stream.on('end', () => resolve(Buffer.concat(chunks).toString('utf8')));
})
}
export async function generateHTMLForArch(arch, includeHead) {
// Use a dummy manifest. None of these paths will be read from the filesystem, but css / js should be handled differently