Electron has no special requirements regarding the code you run. You just need to add a simple wrapper which tells it which file to run. Other than that, it works like a web browser.
I didn’t know about this, but it can definitely be an advantage of NW.js. It looks like it also keeps up with Chromium faster and allows you to remove the developer tools, so it could certainly be the better choice over Electron.