Desktop Apps With JavaScript: Electron And Friends

K - May 28 '17 - - Dev Community

Imagine this: You meeting up with the most senior front-end developers ever and they tell you that Web UIs are totally pleb tier and you can't seriously get any more senior than writing desktop apps. So you search around and find all this crazy stuff like GTK+, Qt and Swing and you realize you don't even know a bit of Java or C++.

So how can you, a JavaScript developer, hold your ground?

Rest assured, for there are projects out there to save your dev cred!

NW.js

The first one is NW.js. In the beginning it was called node-webkit, but I guess since they use Chromium and Chromium itself uses Blink instead of WebKit, the name didn't made much sense anymore.

Anyway, its idea is to merge Node.js and Chromium into a runtime environment for Web-applications, that can access system APIs. So you can use all your Web skills to create desktop UIs and then use your Node.js skills to do all the regular system stuff, like sockets or filesystem access.

The whole runtime is rather heavy, tho. Also memory usage isn't quite like that of a Qt app ;)

Oh and it can run Chrome apps directly, if this is your thing.

Electron

Electron came a few years after NW.js and did things a bit differently. It also uses Node.js, but it only uses parts of Chromium, which should lead to faster build times.

Also, while NW.js is more browser centric, Electron is first about Node.js. So instead of starting with a Web-page, you start with a Node.js process and create your Web-page windows from there.

It's as heavyweight as NW.js, but seemingly used by much more projects these days.

Nidium

Nidium is one of the new kids on the block. It doesn't use Chromium or Nodejs, but Mozillas JavaScript engine SpiderMonkey, with some extras like networking, datastorage and video, written in C++.

It's much smaller than Electron and NW.js, but it doesn't include a whole browser.

You get APIs like Canvas 2D context and WebGL. It comes with its own small layout engine that even has a DOM compat layer, so you can use frameworks like React to structure your apps.

I guess not all Electron and NW.js apps can be rewritten in Nidium, but probably a good part of them.

It also runs on mobile devices.

Electrino

Electrino is a reeeally fresh thing out there. The project just started as a proof of concept, but its based on an interesting idea, to use the preinstalled browser of the OS instead of Chromium and re-implement the Node.js APIs most Electron apps use.

Because Chromium is a big part of NW.js and Electron this could lead to smaller binaries.

Conclusion

Well, probably depends on what you need, like with everything. :D

I guess Nidium could be nice for games and such.

The question of "Electron or Electrino?" (if it becomes ever usable) probably boils down to the question "How much do you want to depent on the OS?". It's nice to ship tiny binaries, but it's also nice to control all the libraries.

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player