Script modifies the /browser/init.js inside electron.asar by adding the --portable-profile-dir argument and setting the userData and userCache folders to that path.
If electron app does not use app.getPath('appData') somewhere else in the code it can be run as a portable application.
Usage: portable-electron-patch <your_electron_asar>
Example: portable-electron-patch E:\WhatsApp\resources\electron.asar
Making WhatsApp desktop application portable
MIT