Node.js: How to read a stream into a buffer?

前端 未结 6 1801
野趣味
野趣味 2020-12-07 12:05

I wrote a pretty simple function that downloads an image from a given URL, resize it and upload to S3 (using \'gm\' and \'knox\'), I have no idea if I\'m doing the reading o

6条回答
  •  無奈伤痛
    2020-12-07 12:59

    I suggest to have array of buffers and concat to resulting buffer only once at the end. Its easy to do manually, or one could use node-buffers

提交回复
热议问题