I am following this lib's easiest node.js example that generates ppt: https://gitbrent.github.io/PptxGenJS/docs/quick-start/
I first tried in React.js, the writeFile() downloads a file so it works, but I don't understand how to do it in Node.js,
I expect that the writeFile() returns a file so I can send back to client, but it returns a string which is confusing. Any help is appreciated, thank you
Code
const createPowerPoint=async(req,res)=>{
// 1. Create a Presentation
let pres = new pptxgen();
// 2. Add a Slide to the presentation
let slide = pres.addSlide();
// 3. Add text to the Slide
slide.addText("Hello World");
// 4. Save the Presentation
let file = await pres.writeFile({ fileName: "Sample Presentation.pptx" });
res.json(file)
}