[ANN] New release of node-webkit - run node.js apps on desktop

2,633 views
Skip to first unread message

Zhao Cheng

unread,
Aug 9, 2012, 2:09:50 AM8/9/12
to nod...@googlegroups.com
Hello everyone,

I'm glad to announce a new release of node-webkit, node-webkit is a
standalone runtime that run apps written in HTML and node.js.

It has been a long time since release, this time we come back with
following features:

* Write apps in modern HTML, CSS, JS and WebGL
* Strong network and native APIs from node.js
* Support modules written in JS and C++
* Easy to package and distribute apps

Here is a quick hello world:

<html>
<head>
<title>Hello World!</title>
</head>
<body>
<h1>Hello World!</h1>
We are using node.js <script>document.write(process.version)</script>
</body>
</html>

Enjoy it at https://github.com/rogerwang/node-webkit , you can find
prebuilt binaries, usage guides and building guides there.

I'll keep working on this project for next a few months, so feel free
to raise issues and request features.

Cheng

Juan Ignacio Dopazo

unread,
Aug 9, 2012, 10:10:46 AM8/9/12
to nod...@googlegroups.com
This is fantastic! I kept waiting for someone to do this. I thought Twitter may eventually release this because they use it for TweetDeck now.

So thank you very much!


One question: I'm trying to package the example hello world app into a single .exe file on Windows. I try copy /b nw.exe+app.nw app.exe, but when I execute it I get the raw NW windows. Am I missing something?

Juan

Tim Caswell

unread,
Aug 9, 2012, 11:16:49 AM8/9/12
to nod...@googlegroups.com
I don't know it this was mentioned before, but could you summarize how
this project differs in goals and maturity to other similar projects
like appjs?

I'm not trying to discourage you, this work is fantastic! I just know
that it's not obvious to everyone what the differences are.
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en

Zhao Cheng

unread,
Aug 9, 2012, 8:47:06 PM8/9/12
to nod...@googlegroups.com
On Thu, Aug 9, 2012 at 10:10 PM, Juan Ignacio Dopazo
<dopaz...@gmail.com> wrote:
> One question: I'm trying to package the example hello world app into a
> single .exe file on Windows. I try copy /b nw.exe+app.nw app.exe, but when I
> execute it I get the raw NW windows. Am I missing something?

Are you sure 'package.json' is in the root of 'app.nw'? And try the
'hello_world.nw' on the github home page.

--
Cheng
Intel Open Source Technology Center

Zhao Cheng

unread,
Aug 9, 2012, 8:57:29 PM8/9/12
to nod...@googlegroups.com
On Thu, Aug 9, 2012 at 11:16 PM, Tim Caswell <t...@creationix.com> wrote:
> I don't know it this was mentioned before, but could you summarize how
> this project differs in goals and maturity to other similar projects
> like appjs?
>
> I'm not trying to discourage you, this work is fantastic! I just know
> that it's not obvious to everyone what the differences are.

You're right, a compare table is necessary, I'll add one in the Wiki page.

In summary, node-webkit is different to appjs in following ways:
1. appjs is a module for node but node-webkit is a standalone runtime.
2. it's hard to distribute app written with appjs, but node-webkit has
a working out of box package system.
3. the webview created by appjs is just a normal webview, it's very
hard to use along with nodejs. But webview created by node-webkit has
integrated nodejs into it, that means you can directly use 'require',
'process' and others in the <script> tag of a html page.
4. write apps with node-webkit is as simple as write a web page, and
even simpler because you can use all nodejs stuff including its third
party modules.

And see our file explorer demo on:
https://github.com/zcbenz/nw-file-explorer

then you'll know how powerful node-webkit is.

Dan Milon

unread,
Aug 10, 2012, 5:18:30 AM8/10/12
to nod...@googlegroups.com
since the latest version of appjs there is a shared context between
node/webkit so you can use node calls inside the "client side" code.
Example here https://gist.github.com/3312818

danmilon.

José F. Romaniello

unread,
Aug 10, 2012, 8:00:18 AM8/10/12
to nod...@googlegroups.com
Hi Zhao, what are the steps to run the file explorer example?

thanks,

2012/8/9 Zhao Cheng <zcb...@gmail.com>

Zhao Cheng

unread,
Aug 11, 2012, 12:02:27 PM8/11/12
to nod...@googlegroups.com
On Fri, Aug 10, 2012 at 5:18 PM, Dan Milon <danm...@gmail.com> wrote:
> since the latest version of appjs there is a shared context between
> node/webkit so you can use node calls inside the "client side" code. Example
> here https://gist.github.com/3312818

Glad to know that, but I still think it's much easier to write apps
for node-webkit ;-P

Zhao Cheng

unread,
Aug 11, 2012, 12:05:27 PM8/11/12
to nod...@googlegroups.com
On Fri, Aug 10, 2012 at 8:00 PM, José F. Romaniello
<jfroma...@gmail.com> wrote:
> Hi Zhao, what are the steps to run the file explorer example?

I've added up instructions for running the file explorer, and it's
quite simple, see again:
https://github.com/zcbenz/nw-file-explorer

Roger Wang

unread,
Aug 12, 2012, 12:48:06 AM8/12/12
to nod...@googlegroups.com
I don't think the 2 projects are the same. In AppJS there is a bridge marshalling the function calls (correct me if I'm wrong) between the processes[1], while in node-webkit, WebKit and NodeJS resides in the same process thus any function call is made directly.

[1] https://github.com/appjs/appjs/blob/master/lib/bridge.js

Roger

avner

unread,
Aug 15, 2012, 11:57:18 AM8/15/12
to nod...@googlegroups.com
Hi all,

Very interesting. I think both node-webkit and app.js take excellent approaches. My understanding is that node-webkit goes all the way in merging node and webkit into one message loop and v8 thread, while app.js keeps node and webkit (CEF) in separate threads and performs clever bridging of contexts between the threads. It seems app.js is robust and clean, but limited, whereas node-webkit aims to be a full blown application platform but may suffer from more stability issues due to the full merger. 

Also, in app.js, I did not see any example of node being called out of the web page - I'm not sure its possible. All the examples I saw are window calls being made from the node side of the code.

I'd be interested to know if these architectural differences seem right to other people?

Thanks,
Avner.

Zhao Cheng

unread,
Aug 15, 2012, 8:45:33 PM8/15/12
to nod...@googlegroups.com
On Wed, Aug 15, 2012 at 11:57 PM, avner <azan...@gmail.com> wrote:
> Hi all,
>
> Very interesting. I think both node-webkit and app.js take excellent
> approaches. My understanding is that node-webkit goes all the way in merging
> node and webkit into one message loop and v8 thread, while app.js keeps node
> and webkit (CEF) in separate threads and performs clever bridging of
> contexts between the threads. It seems app.js is robust and clean, but
> limited, whereas node-webkit aims to be a full blown application platform
> but may suffer from more stability issues due to the full merger.
>
> Also, in app.js, I did not see any example of node being called out of the
> web page - I'm not sure its possible. All the examples I saw are window
> calls being made from the node side of the code.
>
> I'd be interested to know if these architectural differences seem right to
> other people?

On node-webkit you are partly right, node-webkit is an appliaction
platform while appjs is more a node module. But I don't think the way
we merge node and webkit is unstable, we have a wiki page on our
github describing it [1], it works out of box and there is no fancy
magic in it.

As for appjs, node.js and webkit are indeed running in two processes,
bridge between them is done by IPC [2]. The way they did that is
clever, but this kind of clever means dirty and slow and unstable, it
may work sometimes and may fail in other times, while node-webkit just
works.

[1] https://github.com/rogerwang/node-webkit/wiki/How-node.js-is-integrated-with-chromium
[2] https://github.com/appjs/appjs/blob/master/lib/bridge.js

Elijah Insua

unread,
Aug 15, 2012, 9:18:42 PM8/15/12
to nod...@googlegroups.com
On node-webkit you are partly right, node-webkit is an appliaction
platform while appjs is more a node module.

How do you install npm packages when building an app with node-webkit, or do you require an install of node/npm?

As for appjs, node.js and webkit are indeed running in two processes,
bridge between them is done by IPC [2]. The way they did that is
clever, but this kind of clever means dirty and slow and unstable, it
may work sometimes and may fail in other times, while node-webkit just
works.

[2] https://github.com/appjs/appjs/blob/master/lib/bridge.js

This is simply a bridge between CEF's v8 context and node's. It is a bit magical, but it is just javascript.  Anyhow, there is a single process, node, which loads the appjs node addon which is simply a wrapper around CEF1. When appjs moves to CEF3 there will be more than one process, but that is a reflection of how chromium runs these days.

-- Elijah

Zhao Cheng

unread,
Aug 15, 2012, 9:31:30 PM8/15/12
to nod...@googlegroups.com
On Thu, Aug 16, 2012 at 9:18 AM, Elijah Insua <tmp...@gmail.com> wrote:
>> On node-webkit you are partly right, node-webkit is an appliaction
>> platform while appjs is more a node module.
>
> How do you install npm packages when building an app with node-webkit, or do
> you require an install of node/npm?

Just execute 'npm install' will do the work, an 'require' in <script>
tag works for an app like this:

app
|-- index.html
`-- node_modules
|-- module A
`-- module B

Executing apps does not require an install node/npm, but if you want
to use npm you must have one, since we don't ship npm with
node-webkit.

Yucong Sun (叶雨飞)

unread,
Aug 15, 2012, 9:31:49 PM8/15/12
to nod...@googlegroups.com
This is great, is there a possibility to ditch those dlls (beside icu
I think) , since 18mb is still pretty big

Elijah Insua

unread,
Aug 15, 2012, 9:43:45 PM8/15/12
to nod...@googlegroups.com
Just execute 'npm install' will do the work, an 'require' in <script>
tag works for an app like this:

Got ya, makes sense.  In order for that to work properly (I'm looking at osx specifically) you'd need to have node 32bit installed for any addons that you might be adding to your application. This is currently a problem with appjs as well, unfortunately.

-- Elijah

Zhao Cheng

unread,
Aug 15, 2012, 9:53:27 PM8/15/12
to nod...@googlegroups.com
On Thu, Aug 16, 2012 at 9:31 AM, Yucong Sun (叶雨飞) <suny...@gmail.com> wrote:
> This is great, is there a possibility to ditch those dlls (beside icu
> I think) , since 18mb is still pretty big

You can discard dlls prefixed with 'av' if you don't use media related
tags. I'm figuring out a way to reduce the whole size and currently
you had better ship all of them.

Zhao Cheng

unread,
Aug 15, 2012, 10:02:42 PM8/15/12
to nod...@googlegroups.com
On Thu, Aug 16, 2012 at 9:43 AM, Elijah Insua <tmp...@gmail.com> wrote:
> Got ya, makes sense. In order for that to work properly (I'm looking at osx
> specifically) you'd need to have node 32bit installed for any addons that
> you might be adding to your application. This is currently a problem with
> appjs as well, unfortunately.

Only app developer will need npm, I think it's reasonable for them to
have node installed.

Avner Zangvil

unread,
Aug 16, 2012, 4:08:13 AM8/16/12
to nod...@googlegroups.com
Hi Zhao,

Thanks so much for the explanation! I am currently considering which underlying platform (node-webkit or app.js) to use as a basis for a unique application environment that I'm developing. What would be your thoughts on keeping in pace with future releases of Chromium and node? app.js addresses this by packaging itself as a node add-on built as a patch for CEF.

Thanks!
Avner. 

P.S. I believe app.js runs node as a separate thread but in the same process as CEF - not as a separate process. 

Zhao Cheng

unread,
Aug 16, 2012, 4:31:59 AM8/16/12
to nod...@googlegroups.com
On Thu, Aug 16, 2012 at 4:08 PM, Avner Zangvil <azan...@gmail.com> wrote:
> Thanks so much for the explanation! I am currently considering which
> underlying platform (node-webkit or app.js) to use as a basis for a unique
> application environment that I'm developing. What would be your thoughts on
> keeping in pace with future releases of Chromium and node? app.js addresses
> this by packaging itself as a node add-on built as a patch for CEF.

node-webkit's code is kept up with newest node and Chromium's code, I
sync Chromium's code to upstream every a few days, so you don't need
to worry about it. And we're discarding the dependency of CEF now,
next release of node-webkit will be based on Chromium's Content Shell,
so it will be much easier for us to sync with chromium and reuse
chromium's code. node-webkit will be more like a part of Chromium.

As for which platform is suitable for your app, my suggestion is try
writing a simple hello world for both ones and see which one is more
easier, and also consider which one is more suitable for distributing
your app in future.

> P.S. I believe app.js runs node as a separate thread but in the same process
> as CEF - not as a separate process.

I thought app.js is based on CEF3 which is multi-processed, excuse me for that.

Avner Zangvil

unread,
Aug 16, 2012, 4:43:44 AM8/16/12
to nod...@googlegroups.com
Hi Zhao,

I appreciate the adfitional info. Do you know when the Content Shell based release will be available?

Thanks,
Avner.

Zhao Cheng

unread,
Aug 16, 2012, 4:47:56 AM8/16/12
to nod...@googlegroups.com
On Thu, Aug 16, 2012 at 4:43 PM, Avner Zangvil <azan...@gmail.com> wrote:
> I appreciate the adfitional info. Do you know when the Content Shell based release will be available?

Linux version is ready, Windows and Mac version are on the way. It
will be released no more than next week.

Avner Zangvil

unread,
Aug 16, 2012, 6:06:29 AM8/16/12
to nod...@googlegroups.com
Great. In the link re architecture there was mentioned a risk with using callbacks in some scenarios - may I ask if this is solvable or if it is an architectural limitation?

Thanks,
Avner.

Zhao Cheng

unread,
Aug 16, 2012, 8:07:12 AM8/16/12
to nod...@googlegroups.com
On Thu, Aug 16, 2012 at 6:06 PM, Avner Zangvil <azan...@gmail.com> wrote:
> Great. In the link re architecture there was mentioned a risk with using callbacks in some scenarios - may I ask if this is solvable or if it is an architectural limitation?

It is not a problem, the way we use node under WebKit context should
be very safe. What you saw is old uncertain text, I have removed it
now.

Avner Zangvil

unread,
Aug 16, 2012, 8:34:43 AM8/16/12
to nod...@googlegroups.com
Ok - great!

Thanks,
Avner

Chad Retz

unread,
Aug 17, 2012, 3:52:29 PM8/17/12
to nod...@googlegroups.com
This is a fantastic product. I would absolutely love to have the standalone exe creator without the webkit add-on. It would make it worlds easier for node apps to be distributed (especially in commercial settings even though I understand the risks of not requiring an up-to-date, separate node VM). Is it feasible that the embedding logic (which I assume also adds hooks for the fs module) be separate from node-webkit? Is there a method for me to use this now in a headless form (i.e. no index.html) for just my standalone apps (I understand the executable will be bloated w/ Chromium embedded)? Or is there another framework that allows packaging of single, redistributable exe's using node? (I haven't found any).

Zhao Cheng

unread,
Aug 20, 2012, 1:38:50 AM8/20/12
to nod...@googlegroups.com
On Sat, Aug 18, 2012 at 3:52 AM, Chad Retz <chad...@gmail.com> wrote:
> This is a fantastic product. I would absolutely love to have the standalone
> exe creator without the webkit add-on. It would make it worlds easier for
> node apps to be distributed (especially in commercial settings even though I
> understand the risks of not requiring an up-to-date, separate node VM). Is
> it feasible that the embedding logic (which I assume also adds hooks for the
> fs module) be separate from node-webkit? Is there a method for me to use
> this now in a headless form (i.e. no index.html) for just my standalone apps
> (I understand the executable will be bloated w/ Chromium embedded)? Or is
> there another framework that allows packaging of single, redistributable
> exe's using node? (I haven't found any).

You can do it yourself by adding logics in 'src/node.js', it's very easy.

Zhao Cheng

unread,
Aug 20, 2012, 8:25:16 PM8/20/12
to nod...@googlegroups.com
On Mon, Aug 20, 2012 at 11:19 PM, sihorton <siho...@gmail.com> wrote:
> This looks like a great project.
>
> I have downloaded the nw_release_win32 and then I have downloaded a zip of
> https://github.com/zcbenz/nw-file-explorer and extracted to a subdirectory
> called "file-explorer" under nw_release_win32. I then open a console and run
> nw.exe file-explorer it opens a window and shows on the left hand side links
> to Home, Documents, Pictures and then About. When I click these nothing
> happens. I am guessing it should show me the contents of those folders?
>
> Is there anyway to debug the application to find out what is wrong?

Currently released binaries have some bugs that make nw-file-explorer
only able to run on Linux, you have to wait our next release :(

Zhao Cheng

unread,
Aug 23, 2012, 12:38:23 AM8/23/12
to nod...@googlegroups.com
Hello everyone,

node-webkit v0.2.2 is released, this version still contains bugs but
is much stabler than previous one.

You can find newest binaries on https://github.com/rogerwang/node-webkit .

Major changes:

Node
* Update to v0.8.6

Core
* Dependency of CEF is discarded, node-webkit is now based on Content Shell
* Store apps' data separately
* Make DevTools work
* Local information is provided through window.navigator.language
* timers and console related functions are tweaked to minimize conflicts

Windows
* Module finding paths is fixed so `require` would work for third party modules
* Windows version is compiled with openssl now
* Some fixs on the toolbar

Mac
* Binary size is reduced to normal size
* Fix issues on message loop

And many other minor changes on stability.

Aldis Andrejevs

unread,
Aug 23, 2012, 4:23:39 AM8/23/12
to nod...@googlegroups.com
Hi, nice work..

but are you thinking about:

1) hiding the source code
2) and distributing it as one launch file

Zhao Cheng

unread,
Aug 23, 2012, 4:59:25 AM8/23/12
to nod...@googlegroups.com
On Thu, Aug 23, 2012 at 4:23 PM, Aldis Andrejevs <andr...@gmail.com> wrote:
> Hi, nice work..
>
> but are you thinking about:
>
> 1) hiding the source code
> 2) and distributing it as one launch file

Hiding source code is impossible now, what you can do is only
Obfuscation [1], this is a problem faced by all web apps.

As for distribution in one file, did you mean this [2] ?

[1] http://en.wikipedia.org/wiki/Obfuscated_code
[2] https://github.com/rogerwang/node-webkit/wiki/How-to-package-and-distribute-your-apps

Karl Tiedt

unread,
Aug 23, 2012, 5:01:20 AM8/23/12
to nod...@googlegroups.com
After this new release... now on OS X no log out put shows in
terminal... and still cant seem to get my request() example working...
(even more lost now since I cant even see any debug output)

-Karl Tiedt

Aldis Andrejevs

unread,
Aug 23, 2012, 5:36:37 AM8/23/12
to nod...@googlegroups.com
ty, second point is answered, but be cool to have it on OSX too ;)

Zhao Cheng

unread,
Aug 23, 2012, 7:18:10 AM8/23/12
to nod...@googlegroups.com
Your request() example works, if the zip file didn't work that's
because it's not a valid package.

The console didn't work on Mac now, there will be a quick bug fix release soon.
Reply all
Reply to author
Forward
0 new messages