synth icon indicating copy to clipboard operation
synth copied to clipboard

Support node debug mode

Open mikaelhm opened this issue 11 years ago • 6 comments

It would be great if the synth cli supported the node debug flags like so:

synth s --debug and synth s --debug-brk

So I can debug using e.g. node-inspector

mikaelhm avatar May 08 '14 17:05 mikaelhm

I know this could be done with the method mentioned in https://github.com/JonAbrams/synth/issues/15

But I think it would be nice to support it directly.

mikaelhm avatar May 08 '14 17:05 mikaelhm

:+1:

JonAbrams avatar May 08 '14 17:05 JonAbrams

I can imagine one roadblock to enabling this is that fact that the synth command is already invoked by node by the time it can read the debug flag, and so far, it looks like node needs to be started in debug mode, it can't be turned on afterwards.

I suppose a workaround is for synth to recall itself using node passing in the debug command.

JonAbrams avatar May 08 '14 18:05 JonAbrams

Yeah, you're right.

The only way is probably to spawn a new process using child_process.

mikaelhm avatar May 08 '14 18:05 mikaelhm

Maybe another way would be to offer an alternate "binary" called synth-debug that has #!/usr/bin/env node debug as its first line and then invokes a common module that they both use.

JonAbrams avatar May 08 '14 18:05 JonAbrams

Thats a good alternative. Personally I think i am more to the flag/parameter version. Even though thats gonna leave us with two processes.

mikaelhm avatar May 08 '14 19:05 mikaelhm