I've created an application using node.js, and I'm interested to know if it's possible to pack the client side (js, html ,css) and the server side into a standalone application (that doesn't required browser).
-
I suppose you mean "using a conventional UI"? It's not designed for that, so I doubt that it would be highly useful for that. We use our frameworks for the things they are designed for. nodejs isn't even a language, tho, so remember that. It's just a framework to run a javascript app against a javascript VM. – jcolebrand Jan 09 '12 at 20:16
-
2This appears to be part of a Duplicate Pool: http://stackoverflow.com/questions/6145561/is-there-a-way-to-compile-node-js-source-files, http://stackoverflow.com/questions/7557364/packing-node-js-scripts-node-exe-into-a-single-executable, http://stackoverflow.com/questions/8173232/make-exe-from-node-js-app, http://stackoverflow.com/questions/8794140/is-it-possible-to-create-desktop-applications-with-node-js, http://stackoverflow.com/questions/9724817/how-to-create-a-stand-alone-command-line-application-with-node-js, http://stackoverflow.com/questions/13388108/standalone-node-js-application – Mogsdad Mar 10 '13 at 12:50
-
A good list of tools is here: http://stackoverflow.com/a/12486874/32679 – GrGr Jun 30 '13 at 09:14
-
1electron https://github.com/electron/electron is your choice – onmyway133 Jun 13 '17 at 10:32
-
Electron creates 4 heavy Windows processes using a total of 60 MB of memory just for an app that creates a window. The lighter frameworks appear to have been abandoned. – David Spector Aug 22 '20 at 11:47
5 Answers
https://github.com/rogerwang/node-webkit is a project with the goal of running an instance of the webkit browser engine in the same process as nodejs. It allows you to directly use nodes API in the browser. It currently only works on linux works on Windows, Mac and Linux now.

- 44,854
- 16
- 96
- 107
-
This looks similar to appjs - although node-webkit allows you to use Javascript functions directly from the DOM, while appjs (apparently) requires both a server-side and a client-side. – Anderson Green Nov 15 '12 at 06:57
-
Also, do you have any instructions for installing node-webkit? I'm looking forward to learning it. – Anderson Green Nov 15 '12 at 06:58
-
1
-
1
-
3
-
-
I am also investigating this.
AppJS is looking very promising as an api for building cross platform desktop apps using HTML5, CSS3 and NodeJS. Unfortunately for me it's probably not well enough developed for my next project.

- 157,729
- 40
- 374
- 311

- 3,543
- 1
- 32
- 49
-
+1 for a great find. The project looks good with several apps already developed. – Andrew Grothe Jun 25 '13 at 00:41
I have been investigating this very topic since the node-webkit project was announced.
I have a blog post about my early efforts http://csainty.blogspot.com/2012/01/creating-desktop-apps-with-nodejs.html
In the latest code drop you can now specify an application closedown callback, which makes it easy now to instantiate your applicaton and a localhost webserver when the application is started. Then close it all down cleanly when it is closed.
This make it pretty easy to port a web application to the desktop depending on what other server dependencies you might have.
var nwebkit = require('node-webkit'),
http = require('http');
var server = http.createServer(function (req, res) {
// If you need it you can create a local web server
// You can also use express etc if preferred
}).listen(3000, '127.0.0.1');
nwebkit.init({
'url': 'index.html',
'width': 800,
'height': 600,
'onclose': function() {
server.close();
}
});

- 9,086
- 1
- 26
- 31
-
With nwjs no need to start web server to server webapp static assets. You can set "main": "app/index.html" in manifest.json, it can load the webapp from local files, and security restrictions will not apply, you can make ajax etc. – sibidiba Jun 11 '15 at 03:14
you can write a desktop app using Qt with node
see this binding

- 1,613
- 3
- 19
- 26
-
2Unfortunately looks like that nice project is not maintained too much anymore. – taseenb Nov 01 '13 at 21:48
There have been some attempts, but at the moment there isn't a proper library for this:
http://www.readwriteweb.com/hack/2011/04/build-desktop-apps-with-nodejs.php
https://github.com/appcelerator-titans/nodejs-desktop-prototype

- 62,577
- 16
- 155
- 122