My file structure looks as follows:
root
src
test.ts
template.xlsx
dist
// compiled js source ...
In test.ts, I try to reference the spreadsheet template as follows:
path.join(__dirname, "template.xlsx");
But it is searching in path/to/root/dist instead of looking in path/to/root/src. What's the best way to access my file?
If you want to access to /src from /dist you could navigate there like this:
path.join(__dirname + "../src", "template.xlsx");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With