Electron 允许使用 JavaScript、HTML 和 CSS 开发桌面应用程序 (.exe)。它基于 Node.js 和 Chromium
似乎我也可以使用 Cordova 做同样的事情,但是 Cordova 不能做而 Electron 可以做的事情(就桌面应用程序而言)?
我需要构建一个可以全屏显示的应用程序,使用 AppCache( list )并使用 IndexedDB 存储数据。它需要与条码扫描器和串口通信良好配合(例如:https://github.com/voodootikigod/node-serialport)
Apache Cordova is a platform for building native mobile applications using HTML, CSS and JavaScript.
主要区别似乎是 Cordova 主要针对移动平台和应用程序,而 Electron 主要针对桌面平台和应用程序。 Cordova 似乎确实支持 Windows、Ubuntu 和 OS X桌面在某种程度上,但是他们确实在 OS X 存储库中提到了以下内容:
Note that the current focus of this cordova platform is to provide kiosk-like applications for OSX, that usually run fullscreen and have little desktop interaction. So there is no direct support for menus, dock integration, finder integration, documents, etc. Think of it as a mobile app running on a very big screen.
Cordova 的插件系统似乎并不直接与常规 NPM 包和原生 NodeJS 插件兼容,因此您可能必须在使用之前为 node-serialport
创建某种插件 package 器它在 Cordova 应用程序中,或者使用 an existing plugin .