You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have this code which should turn the stream into a buffer with 'stream-into-array'. However, when utilising this buffer, it doesn't work. When using fs to turn it into a file it works well. const stream = await screenshot(url, '900x1000', { crop: true, userAgent: 'Mozilla/5.0 (X11; CrOS x86_64 10718.71.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.87 Safari/537.36', css: 'adblock.css', delay: 3, scale: 1.5 }); let buffer; await toArray(stream) .then(async function (parts) { var buffers = [] for (var i = 0, l = parts.length; i < l ; ++i) { var part = parts[i] buffers.push((part instanceof Buffer) ? part : new Buffer(part)) } buffer = await Buffer.concat(buffers) })
For more context, I'll be sending this buffer through to discord through discord.js but it seems it's not suitable for it.
The text was updated successfully, but these errors were encountered:
I have this code which should turn the stream into a buffer with 'stream-into-array'. However, when utilising this buffer, it doesn't work. When using fs to turn it into a file it works well.
const stream = await screenshot(url, '900x1000', { crop: true, userAgent: 'Mozilla/5.0 (X11; CrOS x86_64 10718.71.2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.87 Safari/537.36', css: 'adblock.css', delay: 3, scale: 1.5 }); let buffer; await toArray(stream) .then(async function (parts) { var buffers = [] for (var i = 0, l = parts.length; i < l ; ++i) { var part = parts[i] buffers.push((part instanceof Buffer) ? part : new Buffer(part)) } buffer = await Buffer.concat(buffers) })
For more context, I'll be sending this buffer through to discord through discord.js but it seems it's not suitable for it.
The text was updated successfully, but these errors were encountered: