I want to write an app via electron
, but the requirement is to update a file which requires root
permission.
It's easy to achieve via cli
, just like sudo vi xxx
.
Is it possible to update the file via electron
?
Yes, it is possible via electron
.
You can use https://github.com/jorangreef/sudo-prompt to exec
a command using sudo
and show a graphical OS password prompt.
You can use sudo-prompt
from Electron as well as from any Node script.
It is regularly updated, has no dependencies and does not require any native compilation.
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