Leia a string usando nodejs de fluxo
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