Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return new Promise(function(res, rej) {
const chunks = [];
streamQueueAsString(dom)
.on('error', rej)
.on('data', chunk => {
chunks.push(chunk.toString());
})
.pipe(
concatStream(function(buffer) {
res([chunks, buffer.toString('utf-8')]);
})
);
});
}