Like node-webkit, Electron provides a platform for writing desktop applications with JavaScript and HTML, and has Node integration to provide access to a low-level system on web pages.
But there are also fundamental differences between the two projects, which makes Electron a completely separate product from node-Webkit:
1 - Enter application
In NW.js, the main entry point for the application is a web page or JS script. You specify the html or js file in package.json and it opens in the browser window as the main application window (in the case of the html entry point) or the script is executed.
In the Electron element, the entry point is a JavaScript script, instead of a direct URL, you need to manually create a browser window and load the html file into it with the corresponding API. You should also listen to window events to decide when to exit the application.
So, Electron works more than at Node.js runtime, and the API is lower. level, you can also use Electron for web testing purposes like phantomjs,
2 - System assembly
To avoid the complexity of building all the chrome, Electron uses libchromiumcontent to access the Xromium Content API, libchromiumcontent is a separate shared library that includes Chromium Content and all its dependencies. Therefore, users do not need a powerful machine for assembling the atomic shell.
3 - Node integration
In node-webkit, the integration of Node on web pages requires the Chrome fix to work, while in Electron we chose a different way to integrate the libuv loop in each platform message loop to avoid Chromium breaking, see the node_bindings code for how this was done .
4 - Multicontext
If you are an experienced node-webkit user, you should be familiar with the concept of Node context and network context, these concepts were invented due to how node-webkit was implemented.
Using the Node multi-contact function, Electron does not introduce a new JavaScript context on web pages.