Reputation: 16090
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
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:
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.
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