UNPKG

@opengis/fastify-table

Version:

core-plugins

8 lines (7 loc) 263 B
const streamToBuffer = (stream) => new Promise((res, rej) => { const buf = []; stream.on('data', (data) => buf.push(data)); stream.on('end', () => res(Buffer.concat(buf))); stream.on('error', (err) => rej(err)); }); export default streamToBuffer;