'How can I change the write location in SheetJS?

I'm using SheetJS to create excel workbooks in node.js, and I could not find anywhere in the documentation how to change the default location for saving the files. No problems with creating the excel file, successfully able to create the file in the root folder of my app.

What I tried:

excel.writeFile(workbook,"some/file/path"+SheetName)

The error message I get says the directory does not exist. This makes sense, as I intend to save the excel file in a newly created folder based on some variables. I cannot use predetermined folders.

Does anyone know how you can change the file path for the created workbook or programmatically create the folder(s) I need to make the above code work?

Thanks All,



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source