setec
setec

Reputation: 16090

Running node-webkit as node.js app

Is there any way to make node.js be host process for a node-webkit application?

I'm using Intellij IDEA for node.js development, and it have best debugger for node atm. But node-webkit presents its own nw.exe process, which can't be debugged by normal node.js environment. Other debug options (chrome devtools) don't match in effeciency with IDEA debug.

IDEA present some kind of nw debug support, but its very raw and works with many glitches and not works for many things.

So I want develop node-webkit app which starts under control of node.js process, like appjs was doing.

Upvotes: 4

Views: 411

Answers (1)

Ricardo Stuven
Ricardo Stuven

Reputation: 4814

You could do that if you manage to launch nw.exe in debug mode using child_process.exec and make sure the line "Debugger listening on port [nnnnn]" is written to stderr, because according to https://youtrack.jetbrains.com/issue/WEB-1919#comment=27-556387

IDE parses it and can understand that a new debug session should be initialized and what debug port is.

That would be enough BUT the problem is:

  1. child_process.exec will not return stderr until the child process ends and it does not provide a way to pipe it to the node.js host.

  2. node-webkit only provide a --remote-debugging-port option to specify the port to open a devtools debugger; there's no option to start in debug mode (something like --debug or --debug-brk)

Upvotes: 1

Related Questions