Desktop HTML5 apps game changer? node-webkit
Node.js brings high-performance access to the local machine resources, so that HTML5 apps can break out of the browser and get access to the file system, databases, server sockets, etc. Just like any other regular application. Check the wiki for more details.
Could it be a game changer?
You get many of the capability of managed frameworks ala .Net / Java with the deployment convenience of a native application.
- The runtime is available for Windows, OSX and Linux, so you’re instantly cross-platform.
- Bundling Chromium means you’re no longer dependent on the browser available on the target machine, its updates… or lack of.
- You just deploy an exe with a few (optional) companion DLLs (which you can just place alongside the exe).
- No registry hacks needed: the apps are portable and can run just fine from an USB stick f.i.
- Application options are controlled by a simple json manifest
Bundling an HTML5 SmartMobileStudio App
I couldn’t resist the temptation to bundle WarTrail, my entry to the recent PGD Challenge as a node-webkit app. The node-webkit runtime stands at about 13 MB in an installer, which is a lot lighter than .Net or Java runtimes, and not so heavy compared to some native frameworks I won’t name whose executables start at 8-9 MB.
If you have a lot of resources and data, it becomes a quite acceptable overhead (f.i. media for WarTrail stands at nearly 17 MB compressed, which is light by modern game standards).
You can download the resulting installer (30 MB, built with node-webkit 0.3.4 & InnoSetup). The app app starts instantly and runs at high speed. Memory usage remains quite reasonable given the media resources involved.
For those that want to try it in Linux or OSX, grab the node-webkit precompiled binaries there (scroll down to “Downloads”), the get WarTrail.zip (17 MB), rename it to “WarTrail.nw” (sorry, server doesn’t recognize .nw extension), and feel free to report back on the bundling capabilities of node-webkit on those two systems.
So there you have it, with node-webkit, a SmartPascal app can look like a native app, behave like one, and access resources like one.