Learning Electron I'd like to do some file processing after a drag and drop. On a Mac the equivalent for tmp is a $TMPDIR
. Referencing the API documentation of app
I was able to locate the app.getAppPath()
which shows my path from a simple console log from main.js. Below app.getAppPath()
there is getPath()
but when I try app.getPath(temp)
:
let foobar = app.getAppPath("temp")
console.log(foobar)
I get an error in the console of:
ReferenceError: temp is not defined
Through my research I've read:
- How to store user data in Electron
- How to get the original path of a portable Electron app?
- Creating and Using Temporary Files
- Get Special folder Path in Electron
- electron temp directory
- How to set a custom path for Electron app installer
In Electron is there a built-in for the temp directory to work on all operating systems or a process
to reference?
Note:
Even after referencing the string of:
console.log(`The temp path is: ${app.getAppPath("temp")}`)
it returns the same response as:
console.log(`The AppPath is: ${app.getAppPath()}`)
which is:
The temp path is: /Users/Grim/Documents/GitHub/electron-quick-start-boilerplate
The AppPath is: /Users/Grim/Documents/GitHub/electron-quick-start-boilerplate
and the above console.log
tests have been added after letWindow
.
console.log(`The temp path is: ${app.getAppPath("temp")}`)
return the same information asapp.getAppPath()
when added to main.js? – Roer