Baca String Menggunakan Stream NodeJs

const stream: InstanceType<typeof PassThrough> = new PassThrough()
stream.write(html)
stream.end()

stream.pipe(createWriteStream(writeFilePath)).on('finish', () => {
  console.info('generate file is working')
})
Restu Wahyu Saputra