node.js 节点 webkit 的替代品?(重要的文件大小)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/22254375/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Alternatives to node webkit? (filesize of importance)
提问by Wesley
Whilst node-webkit is nice, the binaries on mac and linux are over 70MB for a hello world application. Unacceptable.
虽然 node-webkit 很好,但 mac 和 linux 上的二进制文件对于 hello world 应用程序来说超过 70MB。不可接受。
Is there any cross platform library available that simply uses the system default browser? I don't really care if that's IE, or webkit, or ... ? I presume that way the binary would be much smaller.
是否有任何可以使用系统默认浏览器的跨平台库?我真的不在乎那是 IE、webkit 还是...?我认为这样二进制会小得多。
Or is there any cross-platform language that can easily integrate a (system) browser view?
或者是否有任何跨平台语言可以轻松集成(系统)浏览器视图?
Thanks.
谢谢。
采纳答案by Shourya Sharma
EXCERPT from your question: "I don't really care if that's IE"
摘自你的问题:“我真的不在乎那是不是 IE”
https://code.google.com/p/phpdesktop/
https://code.google.com/p/phpdesktop/
You can try the PHP Desktop MSIEfrom the link above, whose minified version is only 5.823 MB
您可以从上面的链接尝试PHP 桌面 MSIE,其缩小版本仅为5.823 MB
回答by Angular University
There is AppJs, but I don't think it could occupy much less space.
有AppJs,但我认为它不会占用更少的空间。
In all cases, a runtime similar to node-webkit is always going to take up some space because it needs to include a webkit rendering engine and a Javascript engine at least, and those are large applications.
在所有情况下,类似于 node-webkit 的运行时总是会占用一些空间,因为它至少需要包含一个 webkit 渲染引擎和一个 Javascript 引擎,而这些都是大型应用程序。
node-webkit can be shared across several node-webkit applications, so it's not needed to install 70MB each time, have a look at this documentationfor further details:
node-webkit 可以在多个 node-webkit 应用程序之间共享,因此不需要每次安装 70MB,查看此文档以获取更多详细信息:


The size of node-webkit is actually quite reasonable compared to other runtimes such as the JVM which takes up several hundreds megabytes, and 70MB as disk size of nowadays is small (as a comparison it's the size of 10/20 pictures).
node-webkit 的大小其实相对于其他运行时来说是相当合理的,比如占用几百兆字节的 JVM,而现在 70MB 的磁盘大小已经很小(作为比较它是 10/20 张图片的大小)。
Concerning one of your questions, node-webkit cannot reuse the already installed Chrome because it's based on Chromium which is a different browser.
关于您的一个问题,node-webkit 无法重用已安装的 Chrome,因为它基于 Chromium,这是一种不同的浏览器。
Also there is no way for it to tap into or reuse existing webkit engines in already installed browsers, because versions might be different, security reasons, etc.
它也无法在已安装的浏览器中利用或重用现有的 webkit 引擎,因为版本可能不同,安全原因等。
Also the webkit in node-webkit is modified to for example allow the user to access the file system, open database connections and all the expected functionality of a non browser based desktop application, so that's another reason why reusing installed browsers is not possible.
此外,node-webkit 中的 webkit 被修改为例如允许用户访问文件系统、打开数据库连接和非基于浏览器的桌面应用程序的所有预期功能,因此这是无法重用已安装浏览器的另一个原因。
回答by Roberto
I think that TiDeSDKCould fit your needs.
我认为TiDeSDK 可以满足您的需求。
It's is designed to create desktop apps, based in node and webkit. According to its web site the application Wunderlist is developed with TiDesdk and its size is about 30MB based in Mac App Store page: https://itunes.apple.com/us/app/wunderlist-to-do-task-list/id410628904?mt=12
它旨在创建基于 node 和 webkit 的桌面应用程序。根据其网站,应用程序 Wunderlist 是使用 TiDesdk 开发的,其大小约为 30MB,基于 Mac App Store 页面:https://itunes.apple.com/us/app/wunderlist-to-do-task-list/id410628904 ?mt=12
However, if the size is reallyimportant for you, maybe you could consider to develop a Chromeor Firefoxextension, that would generate the smallest file to distribute.
但是,如果大小对您来说真的很重要,也许您可以考虑开发Chrome或Firefox扩展程序,这将生成要分发的最小文件。
EDIT:It seems that the people that worked in TideSDK started a new project, TideKit, with a similar key features and including mobile platforms, It's explained here
回答by roland
Sencha Desktop Manageraims to deploy web app on desktop:
Sencha Desktop Manager旨在在桌面上部署 Web 应用程序:
https://www.sencha.com/blog/whats-new-in-sencha-desktop-packager-1-2/
https://www.sencha.com/blog/whats-new-in-sencha-desktop-packager-1-2/
However I don't even know if the tool is still supported. FRom what I heard it is part of Sencha Complete, which is expensive. Besides the API seems limited compared to what NWprovides -- a tool built on top of Nodejs.
但是我什至不知道是否仍然支持该工具。据我所知,它是 的一部分Sencha Complete,价格昂贵。此外,与NW提供的 API 相比,API 似乎有限——一个构建在 Nodejs 之上的工具。
You said the binaries are over 70MB. It depends on what you think is vital: is it the size of your delivery file or the size of your app once installed? Once installed the app may be 70MB.
你说二进制文件超过 70MB。这取决于您认为重要的是什么:是交付文件的大小还是安装后应用程序的大小?安装后,该应用程序可能为 70MB。
However your nwapp must be zipped if you want to distribute it.
I developed a nwapp with 200+ Javascript files. Once zipped the package is 30MB(MAC OS X) and 28.5MB(Windows). I have just checked it.
但是,nw如果您想分发您的应用程序,则必须对其进行压缩。我开发了一个nw包含 200 多个 Javascript 文件的应用程序。压缩包后为30MB(MAC OS X) 和28.5MB(Windows)。我刚刚检查过。
The runtime is heavy, but the rest of the app is light: only Javascript files, images and other kind of files. So not much a huge difference between a hello world app and a not trivial one (although images and other resources can be heavy).
运行时间很重,但应用程序的其余部分很轻:只有 Javascript 文件、图像和其他类型的文件。因此,hello world 应用程序和非平凡应用程序之间没有太大区别(尽管图像和其他资源可能很重)。

