1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Node.js で stream の内容を一時的にメモリで受け止める stream

Posted at
const MemoryStream = require('memorystream');

let writableMemory = new MemoryStream();
readableStream
    .on('data', (data) => {
        writableMemory.write(data);
    })
    .on('end', () => {
        writableMemory.end();
    })
;
  • 当然ながら end 忘れるとストリームが終わったとみなされないので注意。
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?